Hello. I am trying to search a document for the phrase FIG., FIGs. or FIGS. followed by any number and a lower case letter. For example, FIG. 1a. I'm wanting to capitalize the A so that the resulting text is FIG. 1A.
I thought this would do it, but it doesn't, and I'm not sure where I went wrong. The find and basic replace are straightforward enough that I assume it has to be in the UCase portion. Any guidance on where I went wrong?
Code:
With ActiveDocument.Content.Find
.Text = "(FIG. [1-9])([a-z])"
.Replacement.Text = "\1"UCase(\2)
.MatchWildcards = true
.Text = "(FIG[Ss]. [1-9])([a-z])"
.Replacement.Text = "\1"UCase(\2)
.MatchWildcards = true
End With
Bonus points if anyone has an idea on how to tackle a string of multiple similar to "FIGS. 1a, 3b, ..., and 11f ...".