| 1 |
NAME |
| 2 |
Regexp::Trie - builds trie-ized regexp |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use Regexp::Trie; |
| 6 |
my $rt = Regexp::Trie->new; |
| 7 |
for (qw/foobar fooxar foozap fooza/){ |
| 8 |
$rt->add($_); |
| 9 |
} |
| 10 |
print $rt->regexp, "\n" # (?-xism:foo(?:bar|xar|zap?)) |
| 11 |
|
| 12 |
DESCRIPTION |
| 13 |
This module is a faster but simpler version of Regexp::Assemble or |
| 14 |
Regexp::Optimizer. It builds a trie-ized regexp as above. |
| 15 |
|
| 16 |
This module is faster than Regexp::Assemble but you can only add |
| 17 |
literals. "a+b" is treated as "a\+b", not "more than one a's followed by |
| 18 |
b". |
| 19 |
|
| 20 |
I wrote this module because I needed something faster than |
| 21 |
Regexp::Assemble and Regexp::Optimizer. If you need more minute control, |
| 22 |
use those instead. |
| 23 |
|
| 24 |
TIPS |
| 25 |
See t/dict2rx.pl to find how to convert a big dictionary into a single |
| 26 |
regexp that can be later loaded as: |
| 27 |
|
| 28 |
my $rx = do 'dict.rx'; |
| 29 |
|
| 30 |
EXPORT |
| 31 |
None. |
| 32 |
|
| 33 |
SEE ALSO |
| 34 |
Regexp::Optimizer, Regexp::Assemble, Regex::PreSuf |
| 35 |
|
| 36 |
AUTHOR |
| 37 |
Dan Kogai, <[email protected]> |
| 38 |
|
| 39 |
COPYRIGHT AND LICENSE |
| 40 |
Copyright (C) 2006 by Dan Kogai |
| 41 |
|
| 42 |
This library is free software; you can redistribute it and/or modify it |
| 43 |
under the same terms as Perl itself, either Perl version 5.8.8 or, at |
| 44 |
your option, any later version of Perl 5 you may have available. |
| 45 |
|