Hi,
I have a regexp I'm using with sed, but now I need to make it work in PHP also. I can't use system calls as they are disabled.
$ cat uglynumber.txt: Ticket number : 303905694, FOO:BAR:BAR: Some text Case ID:123,456,789:Foobar - Some other text 303867970;[FOOBAR] Some text goes here Case Ref: 303658850 - Some random text here - host.tld #78854w
$ cat uglynumbers.txt | sed "s/[, ]//g;s/.*\([0-9]\{9\}\).*/\1/g" 303905694 123456789 303867970 303658850
So, how to do the same with PHP?
I found one example like this, but I can't inject that regexp into that.
if (preg_match("/.../", $line, $matches)) { echo "Match was found"; echo $matches[0]; }
Please help.
PROBLEM SOLVED! Thank you!
-Samuli