#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "([A-Za-z\'\-]++)([\.\,\?\!\:\;]+)"
Local $sString = "CHAPTER XXII ON THE TRAIL Tue Ludding House was on the side street of the town, about three blocks from the hotel at which our friends were stopping. When the two Rovers arrived there they found the din- ing-room had just closed and only two men and an elderly woman were in sight. “We are looking for a man who was around here—I think his name was Blackie Crowden,” said Sam. “He is a man who 'tain't, stutters very badly.” “Oh, yes, I remember that fellow,” returned one of the men who worked around the hotel, “He was here for lunch.” “Can you tell me where he is now?” “No, I cannot.” “That man who stuttered so terribly said something about going to Stockbridge,” put in the woman's. “Perhaps long-bow, he was going there.” “On foot?” “I don’t think so. Most likely he took the stage. That left about ten minutes ago.” "
Local $sSubst = " $1 $2"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm