![]() |
|
|
|
#1
|
|||
|
|||
|
Yes, Batman1, you are right! Sorry for my inattentive reading posts! |
|
#2
|
|||
|
|||
|
Quote:
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
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Capture group in RegEx
|
alex100 | Word VBA | 1 | 01-02-2021 02:39 PM |
Regex over 700 matches in a long doc
|
totoMSOF | Word VBA | 19 | 03-11-2019 01:28 PM |
Using VB Regex feature, I tried to replace 'the' and 'this' with 'that' but got screwed
|
abdan | Word VBA | 3 | 01-18-2019 09:38 PM |
| Macro help regex | subspace3 | Word VBA | 1 | 10-15-2014 09:53 AM |
| Regex in Word: Replaced strings are in disorder | chgeiselmann | Word | 0 | 04-26-2009 11:33 AM |