in reply to Exclusive pattern matching..
If you really want a regexp for this though, you can use ^ and $ like this:my $input = shift; if($input eq $scalar) ....
^ matches only at the beginning of the string, and $ only at the end, so this way you force it to match only if it matches the whole string.$string =~ /^user1$/;
|
|---|