in reply to Re: Simple RegEX text parser
in thread Simple RegEX text parser

As requested, a "small code involving Regexp::List":

#!/usr/bin/perl -w use strict; use warnings; use Regexp::List; my $l = Regexp::List->new; my $re = $l->list2re(qw/localized held located localization translocat +ed targets reaches exported export/); print "$re\n";

Output:

(?-xism:(?=[ehlrt])(?:loca(?:liz(?:ed|ation)|ted)|t(?:ranslocated|arge +ts)|export(?:ed)?|held|reaches))

Note that I removed a few prepositions since Regexp::List works on a list of words.

HTH,

planetscape