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 2 of 8 Topic 2416 of 2474
Post > Topic >>

Re: Leftmost longest match with DFA search

by Daniel Villeneuve <daniel2villeneuve@[EMAIL PROTECTED] > May 11, 2008 at 11:42 AM

Stefan Monnier wrote:
> 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 of turning the problem "search for RE" into the
> problem "match .*RE" (where I use "match" here to mean "anchored
> search") only gives you the leftmost shortest match.
[snip]
>         Stefan

I've used the approach to compile a DFA for the reverse RE, say ER, and
first match .*ER on the reverse text to find the leftmost anchor point.
  Then match RE from that point to find the longest span.
--
Daniel Villeneuve
Kronos
 




 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 Sat Jul 26 1:10:25 CDT 2008.