# makeregexb - turn a list of words into a regex that can be used to hunt for them # in a list, a string, or files package main; use strict; use MakeRegex; my @list= qw(arm back leg elbow ear eye chin cheek knee head hip tooth teeth lips mouth hair); my($regex) = MakeRegex::make_regex(@list); print "regex: $regex\n"; my $l; foreach (@list) { print "$_:"; if (/$regex/) { print "YES\n"; } else { print "NO\n"; } }