~$ perl -Mstrict -wle 'my $re = "\+ ([a-z])"; if ( "+w" =~ m/$re/xms ) { print "yo"; } else { print "no"; }' Quantifier follows nothing in regex; marked by <-- HERE in m/+ <-- HERE ([a-z])/ at -e line 1.