Regex Problem
| From: | MikeP | Date: | Thu, 18 Dec 2008 14:43:05 +0000 |
| Subject: | Regex Problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-284783@lists.php.net to get a copy of this message | ||
Hello,
I have a quirky behavior I'm trying to resolve.
I have a REGEX that will find a function definition in a php file:
.....function InsertQuery($table,$fields,$values).....
the REGEX is:
$regex='/function [a-z]* *([$a-zA-Z]*)/';
the problem is that:
1. a slash is automattically put in front of the $. This is good but I dont
know how it gets there.
2.a slash is NOT put in front of the parenthesis. Thats bad
3. If I try to escape the parenthesis with a \ , I get \\.
Help