nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
usually i just do a simple match like<li><span class="title">Title</span> MATCH HERE </li>
but i'm running into 2 problems:<li><span class="[^"]+">[^<]+</span>([^<]+)</li>
a_ i can have html in the matched area, which screws up my ability to do a simple stop-match on the < . i've been failing with lookahead/lookbehind. i read the chapters in mastering regex several dozen times, and every time i think i understand these 2 beasts, I realize i dont.
b_ my plan-of-attack is screwed up when i encounter a nested <li>.*</li> tag. i'd like to not use an html tree module to handle this -- and keep it all in regex. is this possible?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simple regex help
by wfsp (Abbot) on Apr 18, 2007 at 16:57 UTC | |
by nmerriweather (Friar) on Apr 18, 2007 at 17:08 UTC | |
by wfsp (Abbot) on Apr 18, 2007 at 17:19 UTC | |
by ikegami (Patriarch) on Apr 18, 2007 at 17:52 UTC | |
by Fletch (Bishop) on Apr 18, 2007 at 17:59 UTC | |
| |
|
Re: simple regex help
by ikegami (Patriarch) on Apr 18, 2007 at 17:14 UTC | |
|
Re: simple regex help
by ikegami (Patriarch) on Apr 18, 2007 at 19:43 UTC | |
|
Re: simple regex help
by Moron (Curate) on Apr 18, 2007 at 17:19 UTC |