Page 1 of 1

WildEdit find and replace two different things

Posted: Thu Oct 18, 2007 9:06 pm
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???

Posted: Thu Oct 18, 2007 9:54 pm
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.

Posted: Thu Oct 18, 2007 10:00 pm
by Soteriologist
Thanks as always for the quick reply ben_josephs!

AWESOME!!! IT WORKS!!!