In the code
< and > identify a 4- or 5-digit 'word' without any letters. You can test it. As for finding 2 in all positions but fifth, Greg's 2nd condition can be used. So, the final code is:
Code:
Sub ScratchMacro()
'Coded by Gregory K. Maxey
'https://www.msofficeforums.com/184580-post31.html
Dim oRng As range
Set oRng = ActiveDocument.range
With oRng.Find
.text = "<[0-9]{4,5}>"
.MatchWildcards = True
While .Execute
If InStr(left(oRng.text, 4), "2") > 0 Then MsgBox oRng.text
Wend
End With
lbl_Exit:
Exit Sub
End Sub
However, I repeat that my (not rich) experience shows that there are situations when only regex can be helpful.