Warning: preg_match(): Unknown modifier '['
I am trying to port eregi over to preg_match yet I keep getting the error?
preg_match($match = '/^http/[0-9]+\\.[0-9]+[ \t]+([0-9]+)[ \t]*(.*)\$/', $headers[0], $matches)
Any help appreciated.
I am trying to port eregi over to preg_match yet I keep getting the error?
preg_match($match = '/^http/[0-9]+\\.[0-9]+[ \t]+([0-9]+)[ \t]*(.*)\$/', $headers[0], $matches)
Any help appreciated.
teammatt3 posted this at 00:35 — 16th January 2011.
He has: 2,102 posts
Joined: Sep 2003
You need to escape the / but if you change the delimiter to a hash, then you won't need to:
#^http/[0-9]+\\.[0-9]+[ \t]+([0-9]+)[ \t]*(.*)\$#
That regex doesn't look right anyway. What are you trying to match?
benf posted this at 12:12 — 16th January 2011.
They have: 426 posts
Joined: Feb 2005
My server does not have cURL installed, this is just part of an HTTP class that does the same job as cURL. because eregi has been deprecated I had to convert it to preg_match.
Why doesnt it look right?
Good Value Professional VPS Hosting
teammatt3 posted this at 21:28 — 16th January 2011.
He has: 2,102 posts
Joined: Sep 2003
Well, I think it matches this: http/1\\2 3 $
I can't imagine that is what you want! Can you post your egregi regex?
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.