[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-greedy wildcard possible? (Long)
From: |
Magnus Lie Hetland |
Subject: |
Re: Non-greedy wildcard possible? (Long) |
Date: |
Wed, 19 May 2004 19:02:11 +0200 |
User-agent: |
Mutt/1.4i |
Frank Heckenbach <address@hidden>:
>
[snip]
> - What Magnus wants is indeed the former, that's why I said there is
> no direct way in flex to do that.
>
> Magnus suggested to use standard regex functions to search for
> `a|bb|ccc', and return the characters before the match as the
> "plain text" token. This should work, but is not possible in flex,
> since flex always matches the patterns from the current position
> (whereas usual regex functions match them anywhere in the string).
I already have a Flex implementation for this that works, actually. It
uses scanner states so that each time a token other than .|\n is
matched, the text up to the current match is returned (with the
appropriate switching of states, calling of yyless(0) and storing of
the current token type).
So that part (returning "non-token" parts of the text as a special
token type) seems to work just fine. But that allows all tokens
everywhere, of course.
--
Magnus Lie Hetland "Wake up!" - Rage Against The Machine
http://hetland.org "Shut up!" - Linkin Park
- Re: Non-greedy wildcard possible? (Long), (continued)
- Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/26
- Re: Non-greedy wildcard possible? (Long), Hans Aberg, 2004/05/19
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/19
- Re: Non-greedy wildcard possible? (Long), Hans Aberg, 2004/05/20
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/20
- Re: Non-greedy wildcard possible? (Long), Hans Aberg, 2004/05/21
Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/18
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/19
- Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/19
- Re: Non-greedy wildcard possible? (Long),
Magnus Lie Hetland <=
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/20
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/20
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/20
- Message not available
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/20
- Re: Non-greedy wildcard possible? (Long), Laurence Finston, 2004/05/20
- Message not available
- Re: Non-greedy wildcard possible? (Long), Magnus Lie Hetland, 2004/05/20
Re: Non-greedy wildcard possible? (Long), Frank Heckenbach, 2004/05/27
Re: Non-greedy wildcard possible? (Long), Hans Aberg, 2004/05/20
RE: Non-greedy wildcard possible? (Long), Vincent Zweije, 2004/05/28