Help needed! Complicated Find/Replace requirement

M

mindful_learner

Hi all,

I've got an urgent find/replace type task that I need help with.

I need to be able to find complicated text sequences such as:

aWord
blank line
blank line
;
a numerical digit

and replace these text sequences with nothing (basically stripping the
word sequences out of the document).

Is there any way to do this using simple find/replace dialogue without
resorting to a macro?

Wild card searches seemed to struggle, as they don't seem to allow you
to use special characters such as 'any digit' after the wildcard (*)
character.

Any help much appreciated,
Stu
 
T

Tony Strazzeri

Have you looked at the help for Find and Replace?
This has extensive ways to construct wildcard searches. I am not an
expert on wildcards but would be surprised if you can't do what you
want to do.

Below is an extract from the help file.

Cheers
TonyS.



When the Use wildcards check box is selected, Word finds only the
exact text you specify. (Notice that the Match case and Find whole
words only check boxes are unavailable (dimmed) to indicate that these
options are automatically on; you can't turn off these options.)
To search for a character that's defined as a wildcard, type a
backslash (\) before the character. For example, type \? to find a
question mark.
Wildcards for items you want to find and replace

To find:
Any single character
Type ?
For example, s?t finds "sat" and "set".
Any string of characters
Type *
For example, s*d finds "sad" and "started".
The beginning of a word
Type <
For example, <(inter) finds "interesting" and "intercept", but not
"splintered".

The end of a word
Type >
For example, (in)> finds "in" and "within", but not "interesting".
One of the specified characters
Type [ ]
For example, w[io]n finds "win" and "won".

Any single character in this range
Type [-]
For example, [r-t]ight finds "right" and "sight". Ranges must be in
ascending order.
Any single character except the characters in the range inside the
brackets
Type [!x-z]
For example, t[!a-m]ck finds "tock" and "tuck", but not "tack" or
"tick".

Exactly n occurrences of the previous character or expression
Type {n}

For example, fe{2}d finds "feed" but not "fed".

At least n occurrences of the previous character or expression
Type {n,}

For example, fe{1,}d finds "fed" and "feed".

From n to m occurrences of the previous character or expression
Type {n,m}

For example, 10{1,3} finds "10", "100", and "1000".

One or more occurrences of the previous character or expression
Type @

For example, lo@t finds "lot" and "loot".

Notes

You can use parentheses to group the wildcard characters and text and
to indicate the order of evaluation. For example, type <(pre)*(ed)> to
find "presorted" and "prevented".
You can use the \n wildcard to search for an expression and then
replace it with the rearranged expression. For example, type (Newton)
(Christie) in the Find what box and \2 \1 in the Replace with box.
Word will find "Newton Christie" and replace it with "Christie
Newton".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top