PIRE – really fast single-pass regex matching
github.com
github.com
500 MB file, regex: .*$
pcre 31.67 MB/s
re2 242.28 MB/s
pire 756.32 MB/s
500 MB file, regex: ABCDEFGHIJKLMNOPQRSTUVWXYZ$
pcre 153.67 MB/s
re2 653.76 MB/s
pire 755.98 MB/s
2 MB file, regex: (\d{3}-|\(\d{3}\)\s+)(\d{3}-\d{4})$
re2 423,76 MB/s
pire 775,89 MB/s
Source: Yandex, the company where PIRE originated. [2] (Russian)https://github.com/highpower/xiva -- asynchronous web-server for server-side part of html5 websockets
https://github.com/khanton/NwSMTP -- they say it's a "nginx for SMTP", a proxy server they use for providing ssl, rbl, antispam and antivirus checks.
Well that rules out nearly every use case I have for needing a regex in the first place.
Of course, I generally never use any of those features except the capture. (And greedy/nongreedy matching, but that is irrelevant if you're not doing a subexpression capture)
How many people do use regexes for boolean operations? I can only think of an instance or two where I have, aside from regular input validation.
> This regular expression will only validate addresses that have had any comments stripped and replaced with whitespace (this is done by the module).
There is filtering done before the regex is applied.
http://www.brics.dk/automaton/
I use this on Android and it performs substantially faster than java.util.regex, of course working within the constraints of DFA/NFA as opposed to the "Perlish" regular expressions.
Edit: And dk.brics.automaton has its own C reimplementation. I wonder how the speed and functionality compare to PIRE?
*Simplicity The design must be simple, both in implementation and interface. It is more important for the implementation to be simple than the interface. Simplicity is the most important consideration in a design.