in reply to Re: Regex keep matching the last possible match (but should get all)
in thread Regex keep matching the last possible match (but should get all)
Dear Perl-Monk,
now I understand whats up with the [^<]+ that has been suggested already. And you are totally right - If I put in brackets whats before the wanted first group, I'll get the whole html-file up to the very last extinfo...
Sadly, when I try to use [^>]+ it still does grab all the content up to the last position. *snip*
/'extinfo\.cgi[^>]+(.+)<\/A.+'status.+>(.+)<\/TD.+nowrap>(.+)<\/TD.+no +wrap>(.+s)<\/TD>.+'>(\d\/\d)<\/TD>.+'>(.+)<\/TD>/g)
this will place the whole html file in $1 except for the next groups. How do I have to write this area behind the 'extinfo\.cgi' to make it stop at the > and get the group correctly?
I tried to use
which yield the same result: all of the .html-file inside $1 except for the last group-matches./'extinfo\.cgi[^>]+>(.+)<\/A.+'status.+>(.+)<\/TD.+nowrap>(.+)<\/TD.+n +owrap>(.+s)<\/TD>.+'>(\d\/\d)<\/TD>.+'>(.+)<\/TD>/g)
I tried to use something like /bla\w{,100}>(.+)<, but this won't match any more. *sigh* a whole working day right now just for making a single RegEx... And I see it comming that I have to insert this "stop at the next whatever" everywhere, because the next .+ between the first () will keep going to the end too, isn't it?
Greetings, a tired Visitor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Regex keep matching the last possible match (but should get all)
by Corion (Patriarch) on May 18, 2015 at 12:52 UTC | |
|
Re^3: Regex keep matching the last possible match (but should get all)
by Anonymous Monk on May 18, 2015 at 12:53 UTC |