Buddyholly83
IS-IT--Management
I am parsing a string that looks like:
I need to pattern match and extract the code of Body, ReceivedAt and Type using memory parentheses. I need $1 $2 and $3. Iam not having much success with this:
and even if this matched, it would only give me one value, $1 - I need $1 $2 and $3.
Thanks in advance
Code:
HTTP/1.1 200 OK
Cache-Control: private
Date: Fri, 12 Aug 2005 08:48:38 GMT
Server: Microsoft-IIS/6.0
Content-Length: 333
Content-Type: text/plain; charset=utf-8
Client-Date: Fri, 12 Aug 2005 08:48:36 GMT
Client-Peer: 217.158.183.37:80
Client-Response-Num: 1
Set-Cookie: ASP.NET_SessionId=fhpmis45n0h4zfbtb2nwkkml; path=/
X-AspNet-Version: 1.1.4322
X-Powered-By: ASP.NET
Body=Test+test+test&ReceivedAt=2005-08-11+15%3a10%3a48Z&Type=Text
I need to pattern match and extract the code of Body, ReceivedAt and Type using memory parentheses. I need $1 $2 and $3. Iam not having much success with this:
Code:
$string =~ m/[A-Za-z]{1,}=([A-Za-z0-9-%]){1,}&{0,1}/;
and even if this matched, it would only give me one value, $1 - I need $1 $2 and $3.
Thanks in advance