PHP grep ?

Associate
Joined
27 Jun 2006
Posts
1,473
Hey guy, looking for a bit of PHP help.

I have a variable that has a lot of text in it, and I am looking for the phrase:

reg_xxxxx where x is a random 5 digit number.

Now in Perl I know I can use grep to find the 'rec_' bit and then print out the whole rec_xxxxx for me, but can't seem to find the right way of doing it in PHP.

I looked at preg_match but that only seems to give a TRUE or FALSE, and doesn't want to return the actual word!

Any help, as always, greatly appreciated!

Thanks
 
Ah you star - after reading it again, I realised I missed the d+ bit to include all the numbers!!

Cheers - saved me ripping me hair out!
 
Back
Top Bottom