RE: [PHP] preg_replace_callback

From: Date: Thu, 04 May 2006 13:22:13 +0000
Subject: RE: [PHP] preg_replace_callback
Groups: php.general 
Request: Send a blank email to php-general+get-235508@lists.php.net to get a copy of this message
[snip] Hi. I have problem with preg_replace_callback. It seems that my pattern is bad, but I can't find any error. Pattern : \[\s*((\d|\w|_)+)\s*\] this pattern is intended to find strings like "[field]", "[ fi12_eld]"... but every time I get warning message "Warning: preg_replace_callback(): Delimiter must not be alphanumeric or backslash in test.php on line 100" [/snip] I think you need pipes or forward slashes around your pattern. Have a look at TFM to see how they do it there; http://www.php.net/preg_replace_callback

« previous php.general (#235508) next »