bradgrafelman wrote:Note that you'll need to add delimiters ('/' is the common choice) to all of the regexp patterns laserlight posted above to get them to work.
I could not get those to work, I have this string:
[220161467752] Transparent Black Celtic ( end time Dec20 )
I want the output to just be:
Transparent Black Celtic
I tried:
preg_replace('/\d{8}[]$/', "", $str);
but get: Warning: preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 10
and, the return string is empty.
I tried:
preg_replace('/(end time [A-Za-z]{3} \d{3})/', "", $str);
no errors or warnings, but it does not take anything out of the original string...
Any ideas? I suppose it could be done with one pattern match?