Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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
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 musing on the Monastery: (14)
As of 2015-11-30 18:31 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (778 votes), past polls