Re: Replacing text via code
- From: "Greg Maxey" <gmaxey@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 May 2005 05:48:41 -0400
Roger,
The parens around the first "([0-9])" is a group (group 1). The parens
around the second "([0-9])" is a group (group 2). In the replace with field
you are putting back the found content of group 1 "\1" the en dash "^=" and
the content of found group 2 "\2"
The a description of most of the special wildcard codes can be found in Word
Help. Here is an excellent reference by fellow MVP Graham Mayor:
http://www.gmayor.com/replace_using_wildcards.htm
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
Roger Spencelayh wrote:
> In article <1116265408.725727.263740@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
> Greg wrote:
>> Something like:
>> <Snip Code>
>
> Thanks for that Greg. Works great.
>
> I follow it down to the line .Replacement.Text = "\1^=\2"
>
> What do the \1 and \2 mean and how do I find out about these codes? Is
> this something specific to Regular Expressions or is it part of the
> Word syntax?
.
- Follow-Ups:
- Re: Replacing text via code
- From: Roger Spencelayh
- Re: Replacing text via code
- References:
- Replacing text via code
- From: Roger Spencelayh
- Re: Replacing text via code
- From: Greg
- Re: Replacing text via code
- From: Roger Spencelayh
- Replacing text via code
- Prev by Date: Re: Replacing text via code
- Next by Date: Re: how can i save settings so word opens up the same way every time?
- Previous by thread: Re: Replacing text via code
- Next by thread: Re: Replacing text via code
- Index(es):