[<>/] # char that is "<", ">" or "/" #### [^<>/] # char that isn't "<", ">" or "/" #### use Test::More tests => 2; $comment = 'foo bar'; ok( $comment =~ m{[^<>/]*}, 'Detect no specials'); $comment = 'foo < bar'; ok( $comment !~ m{[^<>/]*}, 'Detect <'); #### $ perl -MTest::Harness -e'runtests @ARGV' 808525.t 808525.t .. ok All tests successful. Files=1, Tests=2, 0 wallclock secs Result: PASS