Page 1 of 1

Further Regex

Posted: Mon Aug 16, 2004 4:25 pm
by mjseaden
Dear All

I have a string (actually a MySQL query) of the form

Code: Select all

SELECT * FROM Properties WHERE RegionID=X ORDER BY Price
Is there a simple RegEx I could use to extract 'X' from the query?

Many thanks

Mark

Posted: Mon Aug 16, 2004 4:28 pm
by markl999
Maybe:

Code: Select all

preg_match('#RegionID=(.[^ ]*)#', $string, $matches);
echo $matches[1];