You could just reverse your regex with the match variable:
if ( "abbreviation" =~ m/^$str/ ) { #...
Still a regex solution, just not a refactoring of that regex solution.
In reply to Re: Abbreviation regex?
by fishbot_v2
in thread Abbreviation regex?
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |