Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

I wouldn't use a regex here

by tilly (Archbishop)
on Sep 28, 2000 at 02:25 UTC ( #34291=note: print w/replies, xml ) Need Help??

in reply to Big, bad, ugly regex problem

First I would try Parse::RecDescent and see if you can figure that out.

If that fails I would use the fact that when you match in scalar context with /g, you can loop over the variable as you parse it. This allows you to create little parse engines. Not as cute for small problems, but it allows one huge regex to turn into a series of small ones and some looping logic, which is much, much better!

Confession: I don't face this kind of problem often, and I have not faced it since hearing of Parse::RecDescent. So while I think that is a better answer, parse engines are what I have personally done.

Replies are listed 'Best First'.
RE: I wouldn't use a regex here
by princepawn (Parson) on Sep 28, 2000 at 16:50 UTC
    In addition to Parse::RecDescent (which is EXCELLENT --- I am using it 2 hours per day --- it has a ton of awesome features), DCONWAY has also written Text::Balanced which has an HTML/XML tag-parsing function built in.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2020-08-15 14:28 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (78 votes). Check out past polls.