search and replace 1) and 2)...12)

B

Brent

Hi I have a doc that I need to replace a series of numbers with parens 1)
stuff 2) stuff.... 15) stuff etc

I want to replace the 1) ..15) with a 1, etc I tried using wild cards but
it will not let me work with the ) Any ideas how I can do this?

Thanks
Brent
 
K

Klaus Linke

Brent said:
Hi I have a doc that I need to replace a series of numbers with parens 1)
stuff 2) stuff.... 15) stuff etc

I want to replace the 1) ..15) with a 1, etc I tried using wild cards
but it will not let me work with the ) Any ideas how I can do this?


Hi Brent,

Since parentheses are used in wildcard matches to delimit groups, you have
to "escape" them with a backslash in "Find what":

Find what: (^13[0-9]{1,2})\)
Replace with: \1

I included the preceeding paragraph mark ^13 since else the expression might
match numbers in parentheses -- such as in bibliography entries like
"(Darwin 1859)".

Regards,
Klaus
 
K

Klaus Linke

If you don't want to include the paragraph mark, but want to make sure no
more than two numbers are matched, you can use the "beginning of word
anchor" <:

Find what: (<[0-9]{1,2})\)

Klaus
 

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