I am trying to match a string within some HTML but seem to be having some trouble doing so. The following is part of the HTML source that I am looking to match:
name="challenge" value="26eca68705b3b0c76a6d0602937ac524"I want to grab the string for value. I am using grouping in my regexp and expect therefore that $1 will return 26eca68...etc, essentially the string in between the quotes for the value parameter. Here is the regexp I am using:
When $1 is printed it does not just print the text in between the quotes but instead prints all the remaining text after the first quote of the value parameter so like this: 26eca68705b3b0c76a6d0602937ac524" /><input type="hidden" id="md5pass" name="md5pass" value="1" /><input type="hidden" id="noerror" name="noerror" value="1" /><label><span>Email:</span><input type="text" class="inputtext" name="....MORE HTML SOURCE...$returned_data =~ s/\n//g; my $c_code = $returned_data; $c_code =~ m/name="challenge" value="(.*)"/; #" print $1 . "\n";
Any ideas as to why $1 seems to be capturing more that it should?
use strict; use CGI;
In reply to Regexp question by davidov0009
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |