I'm trying to go through a file, and only print out words without a specific letter, specified in a character class.
if ( $+ =~ [^Aa] )
{
print $_;
}
But this doesn't work. What am I doing wrong? The above example should give back a list of words without 'a' or 'A' in them, but it doesn't seem to be working.
The regular expression says "Include a character that is not A or a" not "Includes only characters that are not A or a".
It is also missing delimiters.
$+ =~ /^[^Aa]*$/
or
$+ !~ /[Aa]/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With