Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Example of inconsistent regex matching

by RichardK (Parson)
on Nov 21, 2015 at 16:33 UTC ( #1148309=note: print w/replies, xml ) Need Help??

in reply to Example of brainfog (Was: inconsistent regex matching)

Parsing HTML by hand is always fragile, and in my experience never ends well. Have you considered a module like HTML::TreeBuilder and then use its look_down method to select just the elements you're interested in?

  • Comment on Re: Example of inconsistent regex matching

Replies are listed 'Best First'.
Re^2: Example of inconsistent regex matching
by ww (Archbishop) on Nov 22, 2015 at 00:08 UTC

    Having expressed that wisdom myself, I blush to admit I expected to write a quick and dirty one-off for a job that -- while tedious -- I could have done in far less time manually, and, undoubtedly, were I familiar with the HTML::TreeBuilder or some of it's cousins, with one of those.

    But the truly horrid html (tables nested in tables; etc.) also disinclined me to attack it with a tool that pretty much expects (and I understand it; pls correct me if this is wrong) more-or-less standards-compliant source.

    In short, + + ; thank you ... but at this point, I'm far more interested in the apparently regex anomaly than in re-writing code that might get used as often as annually.

    ++$anecdote ne $data

      What's wrong with nested tables?
      The way forward always starts with a minimal test.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1148309]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2020-06-07 03:20 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (42 votes). Check out past polls.