On Sunday 17 October 2004 03:54, Murray @ PlanetThoughtful wrote: > In this case, I'm trying to perform a preg_match using the following > expression: > > preg_match("/^\[\[ft".$fn[1].":(.*)\]\]$/m",$content,$ft);
Nearly there, except that ']' is not a special char and should not be escaped. > In the above example, the preg_match would be applied twice, once with a > $fn[1] value of 1, the second time with a $fn[1] value of 2. The $content > variable contains the string above. Not sure why you would want to apply the regex more than once. You use: preg_match_all('/^\[\[ft\d{1}:(.*)]]$/m', $content, $ft) That will match ft0 upto ft9, season to taste. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Life is difficult because it is non-linear. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php