Topic: Simple grouping question with Pattern matching (1 of 2), Read 11 times
Conf: Search and Replace
From: Doc Evans
Date: Tuesday, September 01, 2009 08:05 PM

Argh... this weird web system keeps messing with my posts, so that they aren't at all like what I type.

I'll try again.

I want to replace all instances of [letter]"s with [letter]'s.

The documentation seems very clear that I do this with:

Search: |{|A}"s
Replace: \1's

But when I do that, VPW simply inserts the string "\1's" instead of the expected [letter than matched |A]'s

What am I doing wrong???

 


Topic: Re: Simple grouping question with Pattern matching (2 of 2), Read 11 times
Conf: Search and Replace
From: Christian Ziemski
Date: Wednesday, September 02, 2009 03:53 PM

On 02.09.2009 02:05 vtech-search-replace Listmanager wrote:
> From: "Doc Evans"
>
> I want to replace all instances of [letter]"s with [letter]'s.
>
> The documentation seems very clear that I do this with:
>
> Search: |{|A}"s
> Replace: \1's
>
> But when I do that, VPW simply inserts the string "\1's" instead of the
> expected [letter than matched |A]'s
>
> What am I doing wrong???

The main problem seems to be that you are mixing up "Pattern Matching"
and "Regular Expressions".

The feature you are trying to use is only available with Regular
Expressions.

Quote from the help:
> During a search and replace, groups of characters matched during the
> search can be used as part of the replacement text in very flexible
> ways. This is probably the biggest advantage of regular expressions.

So something like this should do it:

Search: ([a-zA-Z])"s
Replace: \1's
Search Mode: "Reg-Exp"


Christian