.
D 2016-09-26T20:05:24.525
L regexp
P da59a416a7841cca6c5c0a180fdc79d00173d164
U aku
W 1503
The Spencer regexp engine is shared between Postgres and TCL.
Here is a link to the internal doc of the engine at Postgres: [http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/regex/README;hb=HEAD]
Another engine of interest is IMHO Google's re2:
* See [https://github.com/google/re2]
* BSD license
* <b>Full unicode</b> range (not just BMP)
* On the negative side, C++.
* Article series on RE engines by the author, [https://swtch.com/~rsc/regexp/regexp3.html] (link to last in the series, has links to the others)
* An interesting point made in that last article: Support of unicode in the UTF-8 domain by matching <b>bytes</b>, not characters, and integrating UTF-8 decoding into the automaton. This also handles character classes by making them a simple alternation of the characters in the class and optimizing the automaton (merging constant prefixes and suffixes). Examples in the article, with pictures. I came across this again when reading a blog article about <a href="http://blog.burntsushi.net/ripgrep/">ripgrep</a> (grep written in the Rust language). Had some other interesting ideas as well, like extraction of fixed sub-strings (prefix, suffix, inside, multiple) with fast search (SIMD Aho-Corasick derivative) for these, as a means of reducing the candidate locations where to try the full regexp. We do have something like that in Expect, with fast-matching *gate-keeper* glob patterns, although we don't do the SIMD thing.
Z 3bc54d6f79b5e94b8ee5cafba3606214