[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unquoted special characters in regexps
From: |
Luc Teirlinck |
Subject: |
Re: Unquoted special characters in regexps |
Date: |
Sun, 5 Mar 2006 13:14:48 -0600 (CST) |
>From my previous reply:
As Andreas already pointed out, there is _no_ way to determine whether
either a `]' _or_ a `\\]' has to be taken literally or closes a
character alternative without parsing the regexp forward from the start.
Well, _in certain cases_, you might be able to determine it sooner by
parsing backward from the `]'. If you see a `]' or "\\]" you know it
has to be taken literally. (Note: the "\\" are irrelevant to the
question again.) But then you do not know whether that earlier `]' or
"\\]" has to be taken literally, without keeping going. If you see an
unquoted [, you know that the `]' closes a character alternative, but
you still do not know whether that `[' is opening that character
alternative or has to be taken literally, as in "[asd[fgh]". If you
encounter another `[' next you know that either that one opens your
character alternative _or_ that the regexp was very poorly written.
But there definitely are many cases where you would have to parse back
all the way to the beginning.
Sincerely,
Luc.
- Re: Unquoted special characters in regexps, (continued)
- Re: Unquoted special characters in regexps, Thien-Thi Nguyen, 2006/03/04
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/04
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/05
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/05
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/06
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/05
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/05
- Re: Unquoted special characters in regexps, Andreas Schwab, 2006/03/05
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/06
- Re: Unquoted special characters in regexps, Luc Teirlinck, 2006/03/05
- Re: Unquoted special characters in regexps,
Luc Teirlinck <=
- Re: Unquoted special characters in regexps, martin rudalics, 2006/03/06