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

c# - IMAP GMAIL getting folder list problem -

CUDA shared memory -