$ perl -le ' my $w = qr{[A-Za-z0-9_]}; print q{With \x{424}:}; print 3+6 if "\x{424}" =~ /$w/; print q{With \x{42}:}; print 3+6 if "\x{42}" =~ /$w/; ' With \x{424}: With \x{42}: 9