k, i'm stumped
Posted: Tue Mar 07, 2006 9:51 am
I'm going to try to simplify my problem, so i hope it's not the complexity of it that's causing the errors.. if it is, i'll post my exact code down the line, but i'll try to recreate it in a simple manner first
I have a $_POST['text'] that I'm going to be processing.
I also have an array
I'm going to be searching $_POST['text'] for matches in the array followed by a number.
IE: I'd want to find
a#1
b#3
f#7
etc.
so I figured something like this would work
But I keep getting a bunch of errors like this:
Is there something wrong in that general code, or would it be more code specific (in which case I'll post the exact, more complex, code)
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