Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: Leftmost lo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 8 Topic 2416 of 2508
Post > Topic >>

Re: Leftmost longest match with DFA search

by Stefan Monnier <monnier@[EMAIL PROTECTED] > May 13, 2008 at 05:02 AM

>> Can someone point me to articles that discuss various ways to get the
>> leftmost longest match when implementing regexp search using a DFA?
>> The "obvious" solution ...

> Actually, the "obvious" solution is to implement unanchored search
> using repeated anchored searches.  Running an anchored DFA search and

Yes, that's the method used in Tcl, as mentioned in your article that
I referred to.  But it's O(N^2), which is disappointing.  The methods
used in TRE or Plan9's regexp lib are O(N), tho using an NFA.

> Tradtionally, when you ask for all matches for a RE in a text, you get
> a set of leftmost-longest non-overlapping matches.

Right.  I'm not looking to find all the matches, just the first one.
I'd even be content with the first leftmost match (not necessarily
longest).

In any case, thank you both for proposing to match backwards.  It seems
to open up new ways to attack the problem.

In any case, I do know some good-enough solutions, but I'm really
looking for literature about the problem and discussions comparing the
various solutions.


        Stefan
 




 8 Posts in Topic:
Leftmost longest match with DFA search
Stefan Monnier <monnie  2008-05-10 04:36:57 
Re: Leftmost longest match with DFA search
Daniel Villeneuve <dan  2008-05-11 11:42:22 
Re: Leftmost longest match with DFA search
Stefan Monnier <monnie  2008-05-13 04:51:39 
Re: Leftmost longest match with DFA search
Danny.Dube@[EMAIL PROTECT  2008-05-15 11:58:45 
Re: Leftmost longest match with DFA search
"Russ Cox" <  2008-05-12 08:09:04 
Re: Leftmost longest match with DFA search
Stefan Monnier <monnie  2008-05-13 05:02:56 
Re: Leftmost longest match with DFA search
Danny.Dube@[EMAIL PROTECT  2008-05-13 13:58:56 
Re: Leftmost longest match with DFA search
"Russ Cox" <  2008-05-14 16:30:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 7:12:42 CDT 2008.