View Single Post
 
Old 02-24-2023, 09:21 AM
alex100 alex100 is offline Windows 7 64bit Office 2016
Advanced Beginner
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default

I would not want to open another thread just for this, so I have one more related question if you do not mind...

This RegEx matches one to ten uppercase words, divided by a space character and ending with a colon and space.

Code:
.Text = "([A-Z]@ ){1,10}[A-Z]@: "
.Replacement.Text = "> \1"
It works good as it is listed above, but when I try to enclose it between two parentheses (to capture the group), I get a 'not valid pattern expression' error. The code is this:

Code:
.Text = "(([A-Z]@ ){1,10}[A-Z]@: )"
.Replacement.Text = "> \1"
How should I write the wildcard pattern, please?

Alex
Reply With Quote