Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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.

Comment on I wouldn't use a regex here
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 cooling their heels in the Monastery: (10)
As of 2014-12-18 05:20 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (42 votes), past polls