If you want to find a substring inside a string, index might be a better choice than a regex (because you don't have to compile the regex, it's probably clearer to other people, and there's less unexpected side effects like metachars):
$string = "This is a non-SENSE sentence"; $substring = "non-sense"; print "Match!" if index(lc $string, lc $substring) >= 0;
In reply to Re: Regex hyphen
by Eily
in thread Regex hyphen
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |