I have an issue with regular expressions in PHP.
I'm trying to find a match for some header data that I received via CURL. However, my regex is matching two lines, instead of one.
Below is my regex pattern:
/^(http\/\d\.\d)\s+(100)\s+([\w\-\s\/\'\"\(\)\\\.]+)$/im
And here is the string I'm trying match:
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Content-Length: 118
Content-Type: text/html; charset=UTF-8
Etag: 8c59b7e37f672374c61245c8115f53d0
Last-Modified: Tue, 16 Aug 2011 20:24:10 GMT
X-Trans-Id: txd6cbafcec90d4e30b2a108ff3157c1b1
Date: Tue, 16 Aug 2011 20:24:10 GMT
It's supposed to match the first line but I'm getting a match for both 100 and 201. I can't understand why it's doing this.
I'm using preg_match by the way.
Any ideas as to how I can solve this? Thanks.