I have a tool similar to "agrep" called "grok" (get regular expression and
make it ok). It uses the flex's regular-expression parsing code, gets rid
of the character classes, builds a "state-labelled e-NFA", and then does
approximate matching with error correction. The algorithm was invented by
Gene Myers and was used to torture prospective PhD students until
recently, when it was replaced by a more advanced algorithm. The code was
posted to alt.sources a couple of months ago.