Share via

Complex search/replace using wild cards

Anonymous
2020-06-16T08:25:04+00:00

I have a list of several hundred names rendered as follows:

BillPeterSmith
JohnJones
SuePritiPatel
PeterOswestryOgrovic
MarkClinton

What I am trying to do is simply add spaces, in MS Word: Bill Peter Smith.

·       I can locate caps at the beginning of words.

·       I THINK I can locate any string of caps within the text (HellooOOOOoooo!)

·       I seem unable to locate a single cap in the middle of a word.

I cannot replace a character found via a wildcard to itself. (For example, I may wish to multiply all numbers (single digits) in my text by ten - find: ^# replace ^#0) but wild cards cannot be used as replacements.

I WILL NOT MANUALLY REPEAT THE SAME OPERATION MULTIPLE TIMES, because the characters I am searching for and replacing are highly changeable,

As a better example, assume my text says something like

5PoundsSteak36PoundsPotatoes

And I want it to say

5 Pounds Steak

36 Pounds Potatoes

I cannot find any way to replace the wild card with the actual character find.

a.       Consider

i.      search >^#<

ii.      replace >^p

iii.      “1dog2cats3mice(blind)”

iv.      dog

cats

mice(blind)

I don’t want to see that!

I want to see:

1 dog

2 cats

3 mice(blind)

Moreover I want to transform “10964Harris3768Lewis866001Benbecula” into

10964 Harris

3768 Lewis

866001 Benbecula

Remember THIS IS MS WORD.

There seem to be fixes which work with numbers which rely on loops and are practical because there are only 8 digits involved. 26 letters needs something more methodical.

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

1 answer

Sort by: Most helpful
  1. Paul Edstein 82,861 Reputation points Volunteer Moderator
    2020-06-16T08:37:13+00:00

    The can be done quite simply via a few wildcard Find/Replace operations. For your:

    1st example:

    Find = ([a-z])([A-Z])

    Replace = \1 \2

    2nd & 3rd examples:

    Find = ([0-9])([A-Za-z][!0-9^13]{1,})

    Replace = \1 \2^p

    2 people found this answer helpful.
    0 comments No comments