in reply to exact word match

It looks like you are trying to use a negated character class ([^ ... ]) to enclose your alternation of words you don't want. That will not work as character classes just deal with single characters. Perhaps something like this would be better.

my $forbidden = qr{^(?:master|model|dbccdb|sybsecurity|sybsystemdb|syb +systemprocs|tempdb|DBA)[a-zA-Z0-9_]+}; if ( $entered =~ $forbidden ) { # Your rejection code here }

I hope this is helpful.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: exact word match
by Anonymous Monk on Dec 22, 2010 at 13:03 UTC
    Thanks for this and the other answers. I can see where I was going wrong now. This has been very helpful.