<s>
TRE	B-Algorithm
is	O
an	O
open-source	B-Application
library	B-Library
for	O
pattern	B-Language
matching	I-Language
in	O
text	O
,	O
which	O
works	O
like	O
a	O
regular	B-Language
expression	I-Language
engine	O
with	O
the	O
ability	O
to	O
do	O
approximate	B-Algorithm
string	I-Algorithm
matching	I-Algorithm
.	O
</s>
<s>
The	O
library	B-Library
is	O
written	O
in	O
C	B-Language
and	O
provides	O
functions	O
which	O
allow	O
using	O
regular	B-Language
expressions	I-Language
for	O
searching	O
over	O
input	O
text	O
lines	O
.	O
</s>
<s>
The	O
main	O
difference	O
from	O
other	O
regular	B-Language
expression	I-Language
engines	O
is	O
that	O
TRE	B-Algorithm
can	O
match	O
text	O
fragments	O
in	O
an	O
approximate	O
way	O
,	O
that	O
is	O
,	O
supposing	O
that	O
text	O
could	O
have	O
some	O
number	O
of	O
typos	O
.	O
</s>
<s>
TRE	B-Algorithm
uses	O
extended	O
regular	B-Language
expression	I-Language
syntax	O
with	O
the	O
addition	O
of	O
"	O
directions	O
"	O
for	O
matching	O
preceding	O
fragment	O
in	O
approximate	O
way	O
.	O
</s>
<s>
TRE	B-Algorithm
allows	O
specifying	O
of	O
cost	O
for	O
each	O
of	O
three	O
typos	O
type	O
independently	O
.	O
</s>
<s>
The	O
project	O
comes	O
with	O
a	O
command-line	O
utility	O
,	O
a	O
reimplementation	O
of	O
agrep	B-Device
.	O
</s>
<s>
Though	O
approximate	O
matching	O
requires	O
some	O
syntax	O
extension	O
,	O
when	O
this	O
feature	O
is	O
not	O
used	O
,	O
TRE	B-Algorithm
works	O
like	O
most	O
of	O
other	O
regular	B-Language
expression	I-Language
matching	O
engines	O
.	O
</s>
<s>
it	O
implements	O
ordinary	O
regular	B-Language
expressions	I-Language
written	O
for	O
strict	O
matching	O
;	O
</s>
<s>
programmers	O
familiar	O
with	O
POSIX-style	O
regular	B-Language
expressions	I-Language
need	O
not	O
do	O
much	O
study	O
to	O
be	O
able	O
to	O
use	O
TRE	B-Algorithm
.	O
</s>
<s>
The	O
library	B-Library
's	O
author	O
states	O
that	O
time	O
spent	O
for	O
matching	O
grows	O
linearly	O
with	O
increasing	O
of	O
input	O
text	O
length	O
,	O
while	O
memory	O
requirement	O
is	O
constant	O
during	O
matching	O
and	O
does	O
not	O
depend	O
on	O
the	O
input	O
,	O
only	O
on	O
the	O
pattern	O
.	O
</s>
<s>
Other	O
features	O
,	O
common	O
for	O
most	O
regular	B-Language
expression	I-Language
engines	O
could	O
be	O
checked	O
in	O
regex	B-Algorithm
engines	I-Algorithm
comparison	I-Algorithm
tables	I-Algorithm
or	O
in	O
list	O
of	O
TRE	B-Algorithm
features	O
on	O
its	O
web-page	O
.	O
</s>
<s>
would	O
match	O
variants	O
of	O
phrase	O
"	O
regular	B-Language
expression	I-Language
"	O
in	O
which	O
"	O
regular	O
"	O
have	O
no	O
more	O
than	O
one	O
typo	O
and	O
"	O
expression	O
"	O
no	O
more	O
than	O
two	O
;	O
as	O
in	O
ordinary	O
regular	B-Language
expressions	I-Language
""	O
means	O
one	O
or	O
more	O
space	O
characters	O
i.e.	O
</s>
<s>
Apart	O
from	O
C	B-Language
,	O
TRE	B-Algorithm
is	O
usable	O
through	O
bindings	B-Application
for	O
Perl	B-Language
,	O
Python	B-Language
and	O
Haskell	B-Language
.	O
</s>
<s>
It	O
is	O
the	O
default	O
regular	B-Language
expression	I-Language
engine	O
in	O
R	O
.	O
However	O
if	O
the	O
project	O
should	O
be	O
cross-platform	B-Operating_System
,	O
there	O
would	O
be	O
necessary	O
separate	O
interface	O
for	O
each	O
of	O
the	O
target	O
platforms	O
.	O
</s>
<s>
Since	O
other	O
regular	B-Language
expression	I-Language
engines	O
usually	O
do	O
not	O
provide	O
approximate	O
matching	O
ability	O
,	O
there	O
is	O
almost	O
no	O
concurrent	O
implementation	O
with	O
which	O
TRE	B-Algorithm
could	O
be	O
compared	O
.	O
</s>
<s>
a	O
replacement	O
mechanism	O
for	O
substituting	O
matched	O
text	O
fragments	O
(	O
like	O
in	O
sed	B-Application
string	O
processor	O
and	O
many	O
modern	O
implementations	O
of	O
regular	B-Language
expressions	I-Language
,	O
including	O
built	O
into	O
Perl	B-Language
or	O
Java	B-Language
)	O
;	O
</s>
<s>
opportunity	O
to	O
use	O
another	O
approximate	O
matching	O
algorithm	O
(	O
than	O
Levenshtein	O
's	O
)	O
for	O
better	O
typo	O
value	O
assessment	O
(	O
for	O
example	O
Soundex	B-Algorithm
)	O
,	O
or	O
at	O
least	O
this	O
algorithm	O
to	O
be	O
improved	O
to	O
allow	O
typos	O
of	O
the	O
"	O
swap	O
"	O
type	O
(	O
see	O
Damerau	O
–	O
Levenshtein	O
distance	O
)	O
.	O
</s>
