Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
But is there a way of combining those two regexps into just one?
I think (untested): =~ /^perfect|perfect$/i will return true if and only if "perfect"(case-insensitive) appears at either the beginning or the end (or both). !~ /^perfect|perfect$/i will return true if and only if "perfect"(case-insensitive) appears neither at the beginning nor the end. Update: As LanX has noted, beginnings such as "perfection" and endings such as "imperfect" will also be matched. Cheers, Rob In reply to Re: Regexp match start or end
by syphilis
|
|