I have created a VBA macro, which is able to find the below possibility of strings.
With mainSel.Find
.ClearFormatting
.MatchWildcards = True
.Text = "[\{\[][a-zA-Z0-9\,\.\:\-;^l^13 ]@[\}\]]"
.Wrap = wdFindContinue
End With
- {xxxxx}
- { xxxx }
- {xxx }
- {xxxx, xxxx}
- { xxxx,xxxx}
- {xxxx,xxxx }
- { xxxx, xxxx }
But the current situation is, when it finds a field code in the document, it skips the all other occurrence of the matches. If I remove the space in the regular expression above it is processing the string after the fieldcode but it is skipping the strings which is having space in it like { xxxx}.
EX: this is an example {xxxx} -getting processed.this is the [fieldcode]. this is the string{xxx} which is not getting processed.