While I’m on the lookout for small libraries anyway, I thought I’d also post a list of a few regular expression libraries I’ve found recently (again, for possible use in an embedded Linux system).
So if you need a small or medium sized regex library for one of your projects, here’s a start:
- SLRE (Super Light Regular Expression library): 15KB of C, but still a decent subset of Perl regexes. Simple API, doesn’t use heap.
- T-Rex: Again, very light at 17KB of C, but good subset of Perl regexes. Uses heap, has a C++ wrapper class.
- TRE: C, lightweight but powerful and POSIX-compliant, looks very good.
- PCRE, C (with C++ wrapper), heavyish, fully-fledged, Unicode support, industry-standard (used in Apache etc).
- Boost.Xpressive: C++ header only, heavyish, API okay, quite hard to extract from Boost.
- Boost.Regex: C++, heavyish, API looks good, hard to extract from Boost.
Being a bloat despiser myself, I love the idea of using just 15KB of source code to handle your regexen. If you need something more powerful, however, TRE does look very good. Somehow reminds me of TCC (Tiny C Compiler).
27 February 2009 by Ben 5 comments