View Single Post
 
Old 09-14-2018, 05:41 PM
Peterson Peterson is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Jan 2017
Posts: 143
Peterson is on a distinguished road
Default Wildcard search once worked, now does not

I need to take a list of phrases with parentheticals next to them and swap their order so that the parenthetical is first, the phrase second, and while stripping the parentheses (and other similar punctuation). I've developed the following find/replace string that I SWEAR I've successfully used multiple times in the past but which is now no longer working. Instead of swapping the first found string and moving to the next one, which is on the following line, the search increments on that first line by just a single character in the first string, then continues swapping, which ain't right.

I ran a macro to reset the wildcard search, restarted Word, to no avail. Is my memory going, or did I fat-finger the find/replace strings?

Here they are, plus a short sample of the text I'm working with:

Find:
(*)( )([\(\[])(*)([\)\];])(^13)

Replace:
\4^t\1\6

Sample list:
Endangered Species Act (ESA)
linear feet (lf)
Federal Emergency Management Agency (FEMA;
river miles [RM]
North American Vertical Datum of 1988 [NAVD88]
right-of-way (ROW)

To be clear, the first find is:

Endangered Species Act (ESA)[paragraph mark]

The first replace is:

ESA[tab]Endangered Species Act

the second find should be linear feet (lf) but it's not; it's this:

SA[tab]Endangered Species Act[paragraph mark]

linear feet (lf)[paragraph mark]
Reply With Quote