if you have an input password in a variable and you want to exactly match 123456, then anchors will help you:
/^123456$/
in perl, the password matching test will look like
print "MATCH_OK" if ($input_pass=~/^123456$/);
EDIT:
bart kiers is right, why donβt you use strcmp () for this? each language has it in its own way.
as a second thought, you may need a more secure authentication mechanism :)
user237419 Apr 22 '11 at 6:29 2011-04-22 06:29
source share