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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find and replace using wildcard



 
 
Thread Tools Display Modes
  #1  
Old February 21st, 2009, 06:06 PM posted to microsoft.public.word.newusers
Jan Kronsell
external usenet poster
 
Posts: 31
Default Find and replace using wildcard

I have a lot of lines tlike this

xxxxxx(1, sdas...
xxxxxx(2, sdas...
xxxxxx(3, sdas...

The xxxxx can be anything. It always contains a left parenthesis, a number
and a comma, though. I want to replace all numbers with " to make the lines
look like

xxxxxx(", sdas
xxxxxx(", sdas
xxxxxx(", sdas

The numbers can have more than one digit. I have tried a lot of
combinations, but it just tells me, its an invalid search expression for
patterns.

Jan


  #2  
Old February 21st, 2009, 08:58 PM posted to microsoft.public.word.newusers
Jay Freedman
external usenet poster
 
Posts: 9,488
Default Find and replace using wildcard

First make sure the "Use wildcards" option in the More section of the Replace
dialog is checked.

The Find What expression should be

([\(])[0-9]{1,}(,)

and the Replace With expression should be

\1"\2

See http://www.gmayor.com/replace_using_wildcards.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.

On Sat, 21 Feb 2009 19:06:06 +0100, "Jan Kronsell"
wrote:

I have a lot of lines tlike this

xxxxxx(1, sdas...
xxxxxx(2, sdas...
xxxxxx(3, sdas...

The xxxxx can be anything. It always contains a left parenthesis, a number
and a comma, though. I want to replace all numbers with " to make the lines
look like

xxxxxx(", sdas
xxxxxx(", sdas
xxxxxx(", sdas

The numbers can have more than one digit. I have tried a lot of
combinations, but it just tells me, its an invalid search expression for
patterns.

Jan

  #3  
Old February 21st, 2009, 09:53 PM posted to microsoft.public.word.newusers
Jan Kronsell
external usenet poster
 
Posts: 31
Default Find and replace using wildcard

Thank you.

Jan

Jay Freedman wrote:
First make sure the "Use wildcards" option in the More section of the
Replace dialog is checked.

The Find What expression should be

([\(])[0-9]{1,}(,)

and the Replace With expression should be

\1"\2

See http://www.gmayor.com/replace_using_wildcards.htm.


I have a lot of lines tlike this

xxxxxx(1, sdas...
xxxxxx(2, sdas...
xxxxxx(3, sdas...

The xxxxx can be anything. It always contains a left parenthesis, a
number and a comma, though. I want to replace all numbers with " to
make the lines look like

xxxxxx(", sdas
xxxxxx(", sdas
xxxxxx(", sdas

The numbers can have more than one digit. I have tried a lot of
combinations, but it just tells me, its an invalid search expression
for patterns.

Jan



 




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 12:24 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.