in reply to more efficient regular expression please

So im not sure what you mean by more efficient. In terms of runtime, or in terms of regex construction. I also dont know what you mean by any pieces of its name, or rather how paranoid you want to be. but this is what I have.
#!/usr/bin/perl use strict; my $str; my $tomatch = 'foobar the vacation.msg is here'; my @permute = map { $str; $str = $_ . $str; } ( reverse( split(//, 'vacation') ) ); $regex = '(\.?(?:' . join('|', reverse(@permute)) . ')\.msg)'; print "$regex\n"; print "Match: $1\n" if ($regex =~ m/$tomatch/ );
HTH

MMMMM... Chocolaty Perl Goodness.....