[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

empty regular expressions don't work on the BSDs

From: Andreas Vögele
Subject: empty regular expressions don't work on the BSDs
Date: Fri, 28 May 2004 22:28:34 +0200

There are five tests in test-suite/tests/numbers.test that use an empty regular expression. Here's the first test:

    "Proper exception with 0 modulus"
    (cons 'numerical-overflow "") <-- empty RE
    (modulo-expt 17 23 0))

The problem is that on Mac OS X and the other BSDs regcomp() does not accept empty regular expressions. The BSD regex implementation is based on Henry Spencer's implementation. I don't know what POSIX says about empty REs but Henry Spencer's manual page says that "an empty string is not a legal RE" (see http://arglist.com/regex/regex3.html).

The tests in numbers.test succeed if the empty REs are replaced with ".". Another option would be to handle empty REs in string-match.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]