LogoopenSUSE Build Service > Projects
Sign Up | Log In


RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library.

Backtracking engines are typically full of features and convenient syntactic sugar but can be forced into taking exponential amounts of time on even small inputs. RE2 uses automata theory to guarantee that regular expression searches run in time linear in the size of the input. RE2 implements memory limits, so that searches can be constrained to a fixed amount of memory. RE2 is engineered to use a small fixed C++ stack footprint no matter what inputs or regular expressions it must process; thus RE2 is useful in multithreaded environments where thread stacks cannot grow arbitrarily large.

On large inputs, RE2 is often much faster than backtracking engines; its use of automata theory lets it apply optimizations that the others cannot.

Unlike most automata-based engines, RE2 implements almost all the common Perl and PCRE features and syntactic sugars. It also finds the leftmost-first match, the same match that Perl would, and can return submatch information. The one significant exception is that RE2 drops support for backreferences┬╣ and generalized zero-width assertions, because they cannot be implemented efficiently. The syntax page gives full details.

Source Files

Filename Size Changed Actions
debian.tar.gz 6.73 KB Download File
re2.dsc 557 Bytes Download File
re2.tar.gz 310 KB Download File

Comments for home:marcelloceschia (0)

Login required, please login or signup in order to comment