I am trying to find every instance of a pattern in a range of cells and replace those instances with a string literal.
Sub poBoxRegEx(myRange As Range)
Dim myRegEx As New VBScript_RegExp_55.RegExp
myRegEx.Pattern = "^[p|P][ |\.]*[o|O|0][\.]* ([b|B]ox[ ]*)"
myRegEx.ignoreCase = True
myRegEx.Global = True
myRegEx.MultiLine = True
myRange.Value = myRegEx.Replace(myRange.Value, "PO Box ")
End Sub
Now every other topic and use case I find online here and else where is creating a function accessible via the function bar. I don't need that because I am not creating something that parses the text in column A and outputs the result to column B. No, I just want this find and replace to replace the original text in the original cell.
^[pP][ .]*[oO0][.]* ([bB]ox *). don't need to give an|inside char class.