View Single Post
 
Old 08-05-2022, 01:21 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

If you are adding another find element inside (brackets) then you will need to account for that shift in the replace with value. For example:
.Text = "(" & arrA(i) & ") ([A-Z0-9]{1,})"
changing to
.Text = "(" & arrA(i) & ")([ \^s])([A-Z0-9]{1,})"
means that you also need to change the replace with to
.Replacement.Text = "\1 <<\3>>"

You can include extra parts of the number by including the stops in the wildcard search
.Text = "(" & arrA(i) & ")([ \^s])([A-Z0-9.]{1,})"

However you may find that if the phrase ends with a stop immediately after the number then it will also be included in the highlighted range.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote