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

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -