Find and replace using wildcard

  • Thread starter Thread starter Jan Kronsell
  • Start date Start date
J

Jan Kronsell

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
 
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
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 
Thank you.

Jan

Jay said:
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
 
Back
Top