I have a $_POST['text'] that I'm going to be processing.
I also have an array
Code: Select all
$array = array('a','b','c','d','e','f');IE: I'd want to find
a#1
b#3
f#7
etc.
so I figured something like this would work
Code: Select all
foreach($array AS $code){
if(preg_match("/$code#(\d{1,2})/",$text,$matches){
// replace it with some stuff
}
}Code: Select all
Warning: preg_match_all(): Compilation failed: unmatched parentheses at offset 2 in /home/smptest/public_html/class/text.class.php on line 233
Warning: preg_match_all(): Compilation failed: unmatched parentheses at offset 2 in /home/smptest/public_html/class/text.class.php on line 233
Warning: preg_match_all(): Compilation failed: unmatched parentheses at offset 1 in /home/smptest/public_html/class/text.class.php on line 233
Warning: preg_match_all(): Compilation failed: unmatched parentheses at offset 1 in /home/smptest/public_html/class/text.class.php on line 233
Warning: preg_match_all(): Compilation failed: missing ) at offset 9 in /home/smptest/public_html/class/text.class.php on line 233
Warning: preg_match_all(): Compilation failed: missing ) at offset 8 in /home/smptest/public_html/class/text.class.php on line 233