Conversely, =~ m#(it\s# would match all of those, whereas each of the replies above avoids that potential problem by requiring a wordboundry -- in this case, a space -- (#\bit\b# or # it # on both sides of any string, "it".
In reply to Re: Regex capture between word and punctuation
by ww
in thread Regex capture between word and punctuation
by negzero7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |