in reply to Subscription Stuff
You want to match at least one, so use '+' instead of '*' as the quantifier. Having passed that, you want to match a non-digit:
sub is_word_with_nondigit { # $_ = shift; # /^\w+$/ and /\D/; $_[0] =~ /^\w+$/ and $_[0] =~ /\D/; }
A different quantifier may be used if you want a minimum length, like /^\w{4,}$/
Update: Modified code to untaint the sub's argument, instead of checking a copy. If you don't like side effects use the commented-out version.
After Compline,
Zaxo
|
|---|