littleperl has asked for the wisdom of the Perl Monks concerning the following question:
I would like to extract the value for 'var nonce' from the following text blob (string)
"... var realm = "heaven"; var nonce = "186248:541534:a67930c5cffeb25a5485e6b4f32570e2"; var qop = "auth"; var uri = "/earth.lp"; ...."
Currently my code looks a like:
my $req = HTTP::Request->new(GET => $server_endpoint); my $resp = $ua->request($req); my $message = $resp->decoded_content; $message =~ m/nonce/i; print " starts: @- \n ends: @+ \n";
To get the begin and end of the nonce keyword (and next I will need to extract the value (186248:541534:a67930c5cffeb25a5485e6b4f32570e2) ).
Problem is I do not get the start or end position back on this string? what am I missing here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: extract pattern from large blob of text
by Corion (Patriarch) on Mar 06, 2015 at 14:40 UTC | |
by littleperl (Initiate) on Mar 06, 2015 at 14:51 UTC | |
by Corion (Patriarch) on Mar 06, 2015 at 14:56 UTC | |
by littleperl (Initiate) on Mar 06, 2015 at 15:14 UTC | |
|
Re: extract pattern from large blob of text
by hdb (Monsignor) on Mar 06, 2015 at 14:52 UTC | |
by littleperl (Initiate) on Mar 06, 2015 at 15:17 UTC |