Share via

Find and Replace Random Strings

Anonymous
2014-02-06T22:02:27+00:00

Hi all,

I'm trying to find and replace a bunch of strings in a Word doc. The strings vary but are all CAPS and all contain a paragraph mark before the string and at the end of the string. The strings are like this:

DUTCH COUNTRY BEAN SOUP

SPLIT PEA SOUP

EGG BALLS FOR SOUP

Is there some way to use wildcards like (^13)([A-Z]{n})(^13) in the Find What box but replace "n" with a variable that will find all uppercase strings even with spaces between words?

And then what would I put in the Replace box to preserve all of text?

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

4 answers

Sort by: Most helpful
  1. Paul Edstein 82,861 Reputation points Volunteer Moderator
    2014-02-07T02:14:44+00:00

    If you want to use all of the found string, one set of parenthesis is all that you need.

    (^13[A-Z ]{1,}^13)

    and then

    \1

    in the Replace with box.

    Actually, if you want to use all of the found string, no parentheses are needed!

    Find = ^13[A-Z ]{1,}^13

    Replace = ^&

    Was this answer helpful?

    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2014-02-07T02:09:37+00:00

    If you want to use all of the found string, one set of parenthesis is all that you need.

    (^13[A-Z ]{1,}^13)

    and then

    \1

    in the Replace with box.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-02-07T01:04:40+00:00

    Hi Doug,

    I want to keep the text but bold change the formatting to bold.

    So I used your magic wildcards and just modified them like so:

    (^13)([A-Z ]{1,})(^13)

    and put \1\2\3 in the Replace box with Bold font formatting for that box.

    Thanks!

    Was this answer helpful?

    0 comments No comments
  4. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2014-02-06T23:10:18+00:00

    Use

    ^13[A-Z ]{1,}^13

    There is a space after the Z before the ]

    You have not told us what you want to replace the string or part of it with so cannot help on the last question.

    Was this answer helpful?

    0 comments No comments