regex - What is wrong with this perl regular expression? -


i'm trying go through file, , print out words without specific letter, specified in character class.

 if ( $+ =~ [^aa] ) { print $_; } 

but doesn't work. doing wrong? above example should give list of words without 'a' or 'a' in them, doesn't seem working.

the regular expression says "include character not or a" not "includes characters not or a".

it missing delimiters.

$+ =~ /^[^aa]*$/ 

or

$+ !~ /[aa]/ 

Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -