If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
search and replace 1) and 2)...12)
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 |
#2
|
|||
|
|||
search and replace 1) and 2)...12)
"Brent" wrote:
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 |
#3
|
|||
|
|||
search and replace 1) and 2)...12)
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 |
Thread Tools | |
Display Modes | |
|
|