Optimize and compile a regular expression into a representation that can be directly used for
matching with match_re()
.
Match a regular expression compiled with compile()
against a string. Returns a tuple of a
boolean (whether there was a match or partial match) and a vector of (position, length)
tuples for all submatches, where the first element describes the match by the whole regular
expression.
Parse, compile, and match a regular expression. Not recommended for repeated use, as the
regular expression will be compiled every time. Use compile()
and match_re()
to make this
more efficient (about 3x faster).
Render the state machine generated from re
as graphviz dot
input. The result can be pasted
into visualize.sh
, which renders a PNG image from it.
Easily take a substring from a match tuple.