in reply to Some sexy regex
#!/usr/bin/perl -l -w use strict; my $str1 = "abc"; my $str2 = "abcde"; my @arr = qw(a b c); my $chars = join '', @arr; my $re = qr(^[\Q$chars\E]+$); print "hello1" if $str1 =~ $re; print "hello2" if $str2 =~ $re; [download]