WildEdit find and replace two different things

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Soteriologist
Posts: 10
Joined: Tue Nov 14, 2006 2:29 am

WildEdit find and replace two different things

Post by Soteriologist »

I'm just wondering if it's possible to search for two different strings at one time and depending on which one is found, replace them with a corresponding string.

In example I want to find:

Code: Select all

Inherits="Blah_
OR

Code: Select all

Partial Class Blah_
and replace them with

Code: Select all

Inherits="
OR

Code: Select all

Partial Class 
For the find I'm using this:

Code: Select all

(Inherits="[^_]+_|Partial Class [^_]+_)
But what do I place in the replace field???
"Education is the progressive realization of our own ignorance" - Sir Albert Einstein
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: (Inherits="[^_]+_)|(Partial Class [^_]+_)
Replace with: ?1(Inherits="):?2(Partial Class)

[X] Regular expression
[X] Replacement format
Search for conditional expression in WildEdit's help.
Soteriologist
Posts: 10
Joined: Tue Nov 14, 2006 2:29 am

Post by Soteriologist »

Thanks as always for the quick reply ben_josephs!

AWESOME!!! IT WORKS!!!
"Education is the progressive realization of our own ignorance" - Sir Albert Einstein
Post Reply