I am using a lib which uses
eregi($match=\"^http/[0-9]+\\\\.[0-9]+[ \\t]+([0-9]+)[ \\t]*(.*)\\$\",$line,$matches)
but as eregi is deprecat
You need to escape the delimiters inside the regular expression (in this case the /):
"/^http\\/[0-9]+\\.[0-9]+[ \t]+([0-9]+)[ \t]*(.*)\$/i"
But you could also chose a different delimiter like ~:
"~^http/[0-9]+\\.[0-9]+[ \t]+([0-9]+)[ \t]*(.*)\$~i"
If you use / as the regex delimiter (ie. preg_match('/.../i', ...)), you need to escape any instances of / in your pattern or php will think it's referring to the end of the pattern.
You can also use a different character such as % as your delimiter:
preg_match('%^http/[0-9]+\.[0-9]+[ \t]+([0-9]+)[ \t]*(.*)$%i',$line,$matches)
You can try:
preg_match("@^http/[0-9]+\\.[0-9]+[ \t]+([0-9]+)[ \t]*(.*)\$@i",$line,$matches)
$match=/ as the delimiter
and there is another / present in the
regex after http, which effectively
marks the end of your regex. When PHP
sees the [ after this it complains.@ or escape the / after http