Topic: Replacing partial found string (1 of 4), Read 17 times
Conf: Search and Replace
From: Walt Pattinson
Date: Monday, February 27, 2006 11:57 AM

Is it possible to search for a string and set the replace string to not replace certain characters?

IOW, I have a search with a wild character or two (|Ttest|d for example) and wish to replace 'test' with 'try' but leave the digit at the end.

Thanks
Walt

 


Topic: Re: Replacing partial found string (2 of 4), Read 22 times
Conf: Search and Replace
From: Christian Ziemski
Date: Monday, February 27, 2006 02:12 PM

On Mon, 27 Feb 2006 11:57:00 -0500, Walt Pattinson wrote:

>Is it possible to search for a string and set the replace string
>to not replace certain characters?
>
>IOW, I have a search with a wild character or
>two (|Ttest|d for example) and wish to replace 'test' with 'try'
>but leave the digit at the end.

That's easily possible with regular expressions.

As macro command: Replace("\ttest([0-9])", "\ttry\1", REGEXP)

Or via menu {Search, Replace}: (without quotes!)
- Search: "\ttest([0-9])"
- Replace: "\ttry\1"
- (o) Reg-Exp


Please note: The above syntax requires at least Vedit 6.15.
Older versions use {} instead of () for grouping.


Christian

 


Topic: Re: Replacing partial found string (3 of 4), Read 25 times
Conf: Search and Replace
From: Walt Pattinson
Date: Monday, February 27, 2006 07:52 PM

Thank you! As a reg-exp weenie I hadn't considered them. After a little help file perusal, I got exactly what I needed!

Thanks for the point in the right direction, Christian!

Walt

 


Topic: Re: Replacing partial found string (4 of 4), Read 23 times
Conf: Search and Replace
From: Ted Green
Date: Tuesday, February 28, 2006 09:21 AM

At 09:13 AM 2/27/2006, you wrote:
>Please note: The above syntax requires at least Vedit 6.15.
>Older versions use {} instead of () for grouping.

Thank you for pointing this out as {} will have a new meaning beginning in VEDIT 6.20; {} will be used as in "[a-z]{4,9}" to mean a count range of the previous item (in this case between 4 and 9 letters).
We are implementing more of the newest regular expressions as in Perl.

Ted.