in reply to Regex capture between word and punctuation

Seconding the replies above, please note that swampyankee, halfcountplus and toolic have each addressed the problem of ensuring the regex does NOT match sit ..., fit. .., split ... or even fergeddaboddit ....

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".