<s>
RE2	B-Algorithm
is	O
a	O
software	B-Library
library	I-Library
for	O
regular	B-Language
expressions	I-Language
via	O
a	O
finite-state	B-Architecture
machine	I-Architecture
using	O
automata	B-Application
theory	I-Application
,	O
in	O
contrast	O
to	O
almost	O
all	O
other	O
regular	B-Algorithm
expression	I-Algorithm
libraries	I-Algorithm
,	O
which	O
use	O
backtracking	B-Algorithm
implementations	O
.	O
</s>
<s>
It	O
provides	O
a	O
C++	B-Language
interface	O
.	O
</s>
<s>
RE2	B-Algorithm
was	O
implemented	O
and	O
is	O
used	O
by	O
Google	B-Application
.	I-Application
</s>
<s>
RE2	B-Algorithm
generally	O
compares	O
to	O
Perl	B-Language
Compatible	I-Language
Regular	I-Language
Expressions	I-Language
(	O
PCRE	B-Language
)	O
in	O
performance	O
.	O
</s>
<s>
For	O
certain	O
regular	B-Language
expression	I-Language
operators	O
like	O
|	O
(	O
logical	O
disjunction	O
or	O
boolean	O
"	O
or	O
"	O
)	O
it	O
exceeds	O
PCRE	B-Language
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
RE2	B-Algorithm
does	O
not	O
support	O
back-references	O
and	O
cannot	O
implement	O
those	O
efficiently	O
.	O
</s>
<s>
It	O
is	O
also	O
slightly	O
slower	O
than	O
PCRE	B-Language
for	O
parenthetic	O
capturing	O
operations	O
.	O
</s>
<s>
PCRE	B-Language
can	O
use	O
a	O
large	O
recursive	O
stack	O
with	O
corresponding	O
high	O
memory	O
use	O
and	O
have	O
exponential	O
runtime	O
on	O
certain	O
patterns	O
.	O
</s>
<s>
In	O
contrast	O
,	O
RE2	B-Algorithm
uses	O
a	O
fixed	O
stack	O
and	O
guarantees	O
that	O
run-time	O
increases	O
linearly	O
(	O
not	O
exponentially	O
)	O
with	O
the	O
size	O
of	O
the	O
input	O
.	O
</s>
<s>
The	O
maximum	O
memory	O
allocated	O
with	O
RE2	B-Algorithm
is	O
configurable	O
.	O
</s>
<s>
RE2	B-Algorithm
has	O
a	O
slightly	O
smaller	O
set	O
of	O
features	O
than	O
PCRE	B-Language
,	O
but	O
has	O
very	O
predictable	O
run-time	O
and	O
a	O
maximum	O
memory	O
allotment	O
.	O
</s>
<s>
PCRE	B-Language
,	O
on	O
the	O
other	O
hand	O
,	O
has	O
almost	O
all	O
of	O
the	O
features	O
that	O
a	O
regular	B-Language
expression	I-Language
library	B-Library
can	O
have	O
,	O
but	O
has	O
unpredictable	O
run-time	O
and	O
memory	O
usage	O
and	O
can	O
grow	O
unbounded	O
.	O
</s>
<s>
RE2	B-Algorithm
is	O
,	O
for	O
example	O
,	O
used	O
by	O
Google	B-Application
products	O
like	O
;	O
Gmail	B-Application
,	O
Google	B-Application
Documents	I-Application
and	O
Google	B-Language
Sheets	I-Language
.	O
</s>
<s>
In	O
Google	B-Language
Sheets	I-Language
,	O
it	O
is	O
used	O
in	O
the	O
functions	O
,	O
,	O
and	O
the	O
.	O
</s>
