Dynamic Regex
| From: | Gerard Samuel | Date: | Thu, 09 Jan 2003 00:25:55 +0000 |
| Subject: | Dynamic Regex | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-130832@lists.php.net to get a copy of this message | ||
The example doesn't have to make sense, but Im looking for the correct syntax for $foo. I was trying ->
$foo = '\[this\](.*?)that';
$bar = 'the other';
$str = preg_replace($foo, $bar, $other_string);
But that doesn't work. I came across an example where the syntax of $foo is in ->
$foo = '#\[this\](.*?)that#';
The second syntax of $foo works. I was wondering on the meaning of # in the string??
Thanks
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/