[imapfilter-devel]imapfilter 0.8.3 & glibc-2.2.93/RH8.0 & regexps
Lefteris Chatzibarbas
lefcha at hellug.gr
Wed Oct 2 19:48:01 EEST 2002
On Wed, Oct 02, 2002 at 01:53:12PM +0300, Lari Hotari wrote:
> Hi!
>
> I just upgraded to RH8.0, which uses glibc 2.2.93 . The regular
> expression syntax has changed, so imapfilter doesn't work properly.
>
> The problems are in using the "|" operator in regular expressions.
>
> for example (line 84 in file.c):
> "^([[:blank:]]*\n|#.*\n)$",
> should be fixed as:
> "^([[:blank:]]*\n)|(#.*\n)$",
>
> The default grouping has somehow changed. All of the regular expressions
> should be checked.
>
> [...]
This is strange... because the first ERE [0], is equivalent to:
match "^[[:blank:]]*\n$" or "^#.*\n$"
while the second:
match "^[[:blank:]]*\n" or "#.*\n$"
This is according to the IEEE Std 1003.1-2001 [1] specification, where is
defined that concatenation has higher order of precedence than alternation,
meaning that "ab|cd" matches "ab" or "cd" rather than "abd" or "acd".
That's the way the glibc-2.2.5, *BSD libc, Perl's regular expressions,
etc. work.
Apart from that, I don't think it is a very good idea to "debug" a program
based on a CVS snapshot(?) of a library...
[0] Extender Regular Expression
[1] POSIX.1-2001
More information about the Imapfilter-devel
mailing list