A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old July 3rd, 2007, 04:48 PM posted to microsoft.public.word.formatting.longdocs
Brent
external usenet poster
 
Posts: 10
Default 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  
Old July 4th, 2007, 06:08 AM posted to microsoft.public.word.formatting.longdocs
Klaus Linke
external usenet poster
 
Posts: 401
Default 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  
Old July 4th, 2007, 06:19 AM posted to microsoft.public.word.formatting.longdocs
Klaus Linke
external usenet poster
 
Posts: 401
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.