Wildcard search want to replace only a portion of what is found

L

Larry

When using a wildcard search example: 19??~ it selects the full yr 1989~.

My question is i want to replace the 19 portion with nothing so that i have
the '89~' left.

When i replace with nothing in the above example....it will wipe out the
whole 1989~ area.

Is there a way just to wipe out the 19 only and leave the 89~ left...i have
a 5000 row text file that i need to do this on.
 
J

Jay Freedman

Taking you literally -- that you want to find only dates starting with 19 --
then in a wildcard replace you can search for

(19)(??~)

and replace it with

\2

which means the second item in parentheses in the search expression.

If you want to match all four-digit numbers, you would change the search
expression to

([0-9]{2})([0-9]{2}~)

and use the same replacement expression.

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.
 

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