i just discovered http://code.google.com/p/re2, a promising library that uses a long-neglected way (Thompson NFA) to implement a regular expression engine that can be orders of
SWIG handles C++ (unlike ctypes), so it may be more straightforward to use it.