Quote:
Originally Posted by vivka
Yes, Batman1, you are right! Sorry for my inattentive reading posts!
|
In fact, it doesn't have to be "|", and the code can be like this
Code:
Sub ScratchMacro()
Dim RegEx As Object, Matches As Object, Match As Object
Set RegEx = CreateObject("VBScript.RegExp")
With RegEx
.Global = True
.Pattern = ",( [A-Za-zü\-]+)* [A-Z][A-Za-zü\-]+,"
End With
Set Matches = RegEx.Execute(ActiveDocument.Range.text)
For Each Match In Matches
Debug.Print Match.Value
Next
End Sub