ThomasJSmart
Programmer
- Sep 16, 2002
- 634
can someone tell me why preg replace ignores the first of the characters im looking for?
$string = 'this is {some} string of {text}';
$replace = preg_replace_callback('/{.*}/i', "Creplace", $replace);
the returned match[0] = '{some} string of {text}'
so whats wrong with the '}' after some?? why is that one being ignored. i should be getting '{some}' returned or am i missing something?
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
$string = 'this is {some} string of {text}';
$replace = preg_replace_callback('/{.*}/i', "Creplace", $replace);
the returned match[0] = '{some} string of {text}'
so whats wrong with the '}' after some?? why is that one being ignored. i should be getting '{some}' returned or am i missing something?
I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!