Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Being Forced to Fork with Nested Regular Expressions

by adrianh (Chancellor)
on Jan 02, 2004 at 17:31 UTC ( #318361=note: print w/ replies, xml ) Need Help??


in reply to Being Forced to Fork with Nested Regular Expressions

Any suggestions to get around this, or am I stuck?

With regexes I think you'll remain stuck. You'll also restrict yourself to assertions about simple strings which I imagine you'll quickly find restrictive.

Personally I think using the call stack to implement your backtracking will be a lot easier - but I would say that wouldn't I :-)


Comment on Re: Being Forced to Fork with Nested Regular Expressions
Replies are listed 'Best First'.
Re: Re: Being Forced to Fork with Nested Regular Expressions
by Ovid (Cardinal) on Jan 02, 2004 at 18:07 UTC

    I once tried to write a generic wrapper using your code, but I failed. I probably just didn't take enough time to play with it, but that was about the point where I stopped working on this last time.

    Cheers,
    Ovid

    New address of my CGI Course.

      Somewhat belated reply ;-)

      Even if you don't use the call stack, I think that the regex engine is probably the wrong choice - it's just not made to be used that way easily (as you've found out :-)

      Implementing backtracking isn't really that hard. All you really need is a stack. I'd start there if it was me.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2015-07-30 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls