$var =~ /^(?:abc)|(?:def)|(?:ghi)$/; is wrong. It matches strings that
You want
$var =~ /^(?:abc|def|ghi)\z/;
In reply to Re^2: regex matching specific strings.
by ikegami
in thread regex matching specific strings.
by nafion112
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |