Re: Leftmost longest match with DFA search
- From: Daniel Villeneuve <daniel2villeneuve@xxxxxxxxxxxx>
- Date: Sun, 11 May 2008 11:42:22 -0400
Stefan Monnier wrote:
Can someone point me to articles that discuss various ways to get the[snip]
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.
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
.
- Follow-Ups:
- Re: Leftmost longest match with DFA search
- From: Stefan Monnier
- Re: Leftmost longest match with DFA search
- References:
- Leftmost longest match with DFA search
- From: Stefan Monnier
- Leftmost longest match with DFA search
- Prev by Date: Re: Introduce a C Compiler ucc
- Next by Date: ANSI C grammar LL(k)
- Previous by thread: Leftmost longest match with DFA search
- Next by thread: Re: Leftmost longest match with DFA search
- Index(es):
Relevant Pages
|
|