Share via

MS Word "Find and Replace" question

Anonymous
2020-02-08T16:32:01+00:00

So I got the Find portion of the problem solved. I wanted to find all instances where a capital o is followed by 5 numbers by using the following sequence of wild cards: <O[0-9][0-9][0-9][0-9][0-9]>

Works perfectly.

I am unable to figure out how to replace it in the manner that I need.

I want to insert a percentage sign in the line above it the found pattern.

For example, I want to change;

O12345

to

%

O12345

And I want to Replace All instances in the document.

Any suggestions would be greatly appreciated.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Paul Edstein 82,861 Reputation points Volunteer Moderator
2020-02-09T05:18:44+00:00

It's even simpler than that:

Find = <O[0-9]{5}>

Replace = %^p^&

and, if you know that string never occurs as part of a larger string, you can even dispense with the < and >.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2020-02-08T17:22:39+00:00

Enter

(<O[0-9]{5,5}>)

in the Find what box, and

%^p\1

in the Replace with box, then click Replace All.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-02-10T03:58:13+00:00

    Thanks Paul

    I will try that too.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2020-02-08T23:52:23+00:00

    Worked perfectly. Thank-you very much, HansV

    Was this answer helpful?

    0 comments No comments