I'm trying to create a macro that replaces a piece of text with specific conditions.
For example:
if it's shown in the document "Summary nº 123" then keep the text the way it is,
but if it is shown "Summary 321" without the 'nº' in the text, I want the macro to add the 'nº' between Summary and 321 (Summary nº 321) while keeping all the "Summary" followed by nº unchanged and not duplicating them (Summary nº nº 123).
I already tried to use wildcards but to no avail. Maybe I didn't use the right combination of wildcards, but I have no idea on how to solve the problem.


Try this: (supposed that there is only one space between "Summary and the number or № sign.