ANN: regex-posix-unittest-1.0 AND regex-posix-0.94.1 AND regex-tdfa-0.97.1

ChrisK haskell at
Mon Feb 2 15:27:47 EST 2009

I have three announcements to make about regex-* related packages.

The regex-posix-0.94.1 package update provides better semantics for multiple 
matches.  Below version 0.94, if any match was empty the matching would stop. 
Now the empty match is returned and the position is incremented and the 
searching continues.

The regex-tdfa-0.71.1 package update provides the same new multiple match 
semantics.  It also fixes a bug I found.  I know of no outstanding bugs in 
regex-tdfa, and version 0.71.1 now passes all the tests used in 
regex-posix-unittest-1.0 announced below.

We should care about the correctness of our operating system libraries.
To help with this, I have a NEW package to announce: regex-posix-unittest-1.0

The accompanying wiki page is

This new package provides an executable called regex-posix-unittest which you 
can install as --user or --global.

The regex-posix-unittest executable with no arguments runs a suite of unit 
tests, all of which are described by text files in the package, the format is 
documented in the wiki page.  By editing the text files in the package you can 
add to or delete from the unit tests being run.

With two arguments the program expects the text first and the pattern second and 
will run just that match and print all the results.

How does regex-posix-unittest help us care about the OS libraries?

The regex-posix distributed in the GHC bundle uses the OS C library's "regex.h" 
API.  The regex-posix-unittest package will quite likely show you that your OS C 
library "regex.h" API is full of bugs.

If you are on Linux, it will show you a plethora of GLIBC bugs in Posix conformance.

If you are on OS X, FreeBSD, or NetBSD, it will show you many bugs including a 
critical bug where it fail to find a match where one actually exists.

These bugs in the OS library are inherited by your "sed" program as well as 
regex-posix and Haskell.

If you are on Windows, or OpenBSD, or Solaris, or anything else, then please 
update the wiki page at or email 
me with your results so I can update the wiki.

You may have evil and ingenious tests of Posix extended regular expressions to 
add to the test suite.  Adding them is easy and if you send them to me I will 
put them in an updated version of regex-posix-unittest.


More information about the Libraries mailing list