Re: Suggestion for Enhancement; B, H, ... and D
2002-02-19 21:39:28
"David W. Tamkin" <dattier(_at_)ripco(_dot_)com> writes:
...
| | You can do ranges using multiple nested paren expressions with '?', so
| | instead of writing, for example, "a{3,7}" you would write:
| | aaa(a(a(aa?)?)?)?
It was either that or aaa(((aa?)?a)?a)? but I can never remember which.
The former. Why? Well...
Imagine we have the string "aaaab" and we trying matching it with the
two regexps:
aaa(a(a(aa?)?)?)?b
and aaa(((aa?)?a)?a)?b
Once procmail has matched the first three 'a' and sees that next character
is an 'a', it has to decide how to match it. With the first regexp
aaa(a(a(aa?)?)?)?b
^
that 'a' has to be matched by the one marked with a caret. On the other
hand, with the second regexp
aaa(((aa?)?a)?a)?b
^^ ^ ^
that next 'a' could be matched by any of the four remaining 'a's in
the regexp, depending on how many more 'a's there are after it. If,
as if the case here, there are no more 'a's, then the last ones marked
with a caret is the 'real' match, but it won't know that until it tries
to match the next character.
Does that help?
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
Re: Suggestion for Enhancement; B, H, ... and D, Udi Mottelo
Re: Suggestion for Enhancement; B, H, ... and D, erik
- Re: Suggestion for Enhancement; B, H, ... and D, David W. Tamkin
- Re: Suggestion for Enhancement; B, H, ... and D, Bart Schaefer
- Re: Suggestion for Enhancement; B, H, ... and D, Don Hammond
- Re: Suggestion for Enhancement; B, H, ... and D, David W. Tamkin
- Re: Suggestion for Enhancement; B, H, ... and D,
Philip Guenther <=
- best way to express a{3,7}, David W. Tamkin
Re: Suggestion for Enhancement; B, H, ... and D, Jacques L'helgoualc'h
Re: Suggestion for Enhancement; B, H, ... and D, David W. Tamkin
Re: Suggestion for Enhancement; B, H, ... and D, Jacques L'helgoualc'h
Re: Suggestion for Enhancement; B, H, ... and D, David W. Tamkin
Re: Suggestion for Enhancement; B, H, ... and D, Jacques L'helgoualc'h
Re: Suggestion for Enhancement; B, H, ... and D, erik
|
Previous by Date: |
Re: Suggestion for Enhancement; B, H, ... and D, David W. Tamkin |
Next by Date: |
best way to express a{3,7}, David W. Tamkin |
Previous by Thread: |
Re: Suggestion for Enhancement; B, H, ... and D, David W. Tamkin |
Next by Thread: |
best way to express a{3,7}, David W. Tamkin |
Indexes: |
[Date]
[Thread]
[Top]
[All Lists] |
|
|