more useful options | |
PerlMonks |
[Solved]: Query about regular expressionby Perl300 (Friar) |
on Sep 23, 2015 at 21:59 UTC ( [id://1142838]=perlquestion: print w/replies, xml ) | Need Help?? |
Perl300 has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks,
Please forgive me for asking something that might be very simple. I have a string variable $form_dump that is bascially the output of $query->Dump; from a html form submit. So everything in the form is taken into this string variable, which is a multiline variable. The contents of it look like:
What I am trying to do is to get each line between fourth pair of <li> & </li> and put those lines in an array. So far I have tried:
This gives the text between first pair of <li> & </li> which is <strong>site_user</strong>. Can I get some clues on how to skip the first three pairs of <li> & </li> and and then stop after text between fourth pair is pulled. I had tried something like $form_dump =~ m{(<li>)(^average_.*?)(</li>)}s in an attempt to get only that text which starts with "average_" but it doesn't match anything and $inside_li prints blank. I am doing something wrong or missing something there. Update: Updated subject line to mark solved.
Back to
Seekers of Perl Wisdom
|
|