Sub SingleBeforeDigit()
Dim regEx As Object
Dim match As Object
Dim fullNamePattern As String
' Create a RegExp object
Set regEx = CreateObject("VBScript.RegExp")
' Set the regular expression pattern for a full name
fullNamePattern = "‘(?=\d)"
With regEx
.Global = True ' Set global matching mode
.Pattern = fullNamePattern ' Assign the pattern
' Loop through all matches of the full name pattern
For Each match In .Execute(ActiveDocument.Content.Text)
' Replace the matched text
ActiveDocument.Range(match.FirstIndex, match.FirstIndex + Len(match.Value)).Text = chr(136)
Next match
End With
End Sub
|