Page 1 of 1

Question about Patterns

Posted: Sun Jun 18, 2006 10:08 am
by phpCCore Brad
Hi, I have been working more and more with patterns and I have came across a problem I can't figure out. I need to find what is between a string and a space.

Example of the string which is code:

Code: Select all

query("INSERT INTO " . db_extension() . "keywordPrim (keyword,count) VALUES ('" . $word . "','" . $endCounts[$key] . "')");
I need to find what is between db_extension() . " and the blanks space after keywordPrim.

I have the following search:

Code: Select all

eregi('\db_extension\(\) \. \"([^[]*)\s', $file, $matches);
This returns the following array:

Array ( [0] => db_extension() . "keywordPrim (keyword,count) VALUES ('" . $word . "','" . $endCounts [1] )

I have tried using the hex versions of the blanks space and the ( and either get nothing or the same results. Any help would be greatly appreciated.

Thanks