littleperl has asked for the wisdom of the Perl Monks concerning the following question:
With the following regex I would like to extract the value for "rn", only after the "action=login" has occured. This because the page (text) from which I want to extract this has multiple "rn" occurances.
a little help on this would be very welcome, as this goes well beyond my perl/regex knowledge
source string:.... <form method="post" action="login.lp" name="authform" id="authform"> <input type="hidden" name="rn" value="-1383135969">
my working regex so far:
$message =~ /\"rn\"\s+value\=+"([^"]+)"/ ; $rn= $1;
my attempt of recognizing the pattern first:
$message =~ /^action.*\"rn\"\s+value\=+"([^"]+)"/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex match after pattern
by choroba (Cardinal) on Mar 12, 2015 at 15:52 UTC | |
by marinersk (Priest) on Mar 12, 2015 at 16:05 UTC | |
by choroba (Cardinal) on Mar 12, 2015 at 16:08 UTC | |
by Anonymous Monk on Mar 12, 2015 at 22:59 UTC | |
by littleperl (Initiate) on Mar 13, 2015 at 14:58 UTC | |
|
Re: regex match after pattern
by Athanasius (Archbishop) on Mar 12, 2015 at 16:04 UTC | |
|
Re: regex match after pattern
by ww (Archbishop) on Mar 12, 2015 at 16:19 UTC |