Hi all,
I am trying to do the following (ultraedit 12.?) :
Remove (replace with an empty string, or maybe a space) all of the instances of <br> in a string UNLESS they occur between THEN and ENDCASE or DEFAULT and ENDDEFAULT.
So
{SELECT {[Liste1]} <br>CASE "3case" <br> THEN 1<br> ENDCASE<br>CASE "1" THEN 2 ENDCASE<br> DEFAULT Default<br> a moi ENDDEFAULT<br>
ENDSELECT}
Should end up
{SELECT {[Liste1]} CASE "3case" THEN 1<br> ENDCASE CASE "1" THEN 2 ENDCASE DEFAULT Default<br> a moi ENDDEFAULT
ENDSELECT}
I was thinking that lookaround was the way to go but nothing I try (and I won't bother you with the 10s of useless expressions I've tried!) gets me anywhere...
If there are any true demons out there, then what we really need to end up with is something that will do the following...
{SELECT {[Liste1]} <br>CASE "3case" <br> THEN 1 {SELECT {[Liste1]} <br>CASE "3case" <br> THEN 1<br> ENDCASE<br>CASE "1" THEN 2 ENDCASE<br> DEFAULT Default<br> a moi ENDDEFAULT<br>
ENDSELECT} ENDCASE<br>CASE "1" THEN 2 ENDCASE<br> DEFAULT Default<br> a moi ENDDEFAULT<br>
ENDSELECT}
Goes to :
{SELECT {[Liste1]} CASE "3case" THEN 1 {SELECT {[Liste1]} CASE "3case" THEN 1<br> ENDCASE CASE "1" THEN 2 ENDCASE DEFAULT Default<br> a moi ENDDEFAULT
ENDSELECT} ENDCASE CASE "1" THEN 2 ENDCASE DEFAULT Default<br> a moi ENDDEFAULT
ENDSELECT}
So in fact the <br> can/should be removed between THEN and ENDCASE (and DEFAULT and ENDDEFAULT) but ONLY if the <br>s are within a {SELECT...ENDSELECT}, and within that the normal rules should apply...
Am I as clear as mud?
Any help or abuse most appreciated!
Cheers
Anton
I am trying to do the following (ultraedit 12.?) :
Remove (replace with an empty string, or maybe a space) all of the instances of <br> in a string UNLESS they occur between THEN and ENDCASE or DEFAULT and ENDDEFAULT.
So
{SELECT {[Liste1]} <br>CASE "3case" <br> THEN 1<br> ENDCASE<br>CASE "1" THEN 2 ENDCASE<br> DEFAULT Default<br> a moi ENDDEFAULT<br>
ENDSELECT}
Should end up
{SELECT {[Liste1]} CASE "3case" THEN 1<br> ENDCASE CASE "1" THEN 2 ENDCASE DEFAULT Default<br> a moi ENDDEFAULT
ENDSELECT}
I was thinking that lookaround was the way to go but nothing I try (and I won't bother you with the 10s of useless expressions I've tried!) gets me anywhere...
If there are any true demons out there, then what we really need to end up with is something that will do the following...
{SELECT {[Liste1]} <br>CASE "3case" <br> THEN 1 {SELECT {[Liste1]} <br>CASE "3case" <br> THEN 1<br> ENDCASE<br>CASE "1" THEN 2 ENDCASE<br> DEFAULT Default<br> a moi ENDDEFAULT<br>
ENDSELECT} ENDCASE<br>CASE "1" THEN 2 ENDCASE<br> DEFAULT Default<br> a moi ENDDEFAULT<br>
ENDSELECT}
Goes to :
{SELECT {[Liste1]} CASE "3case" THEN 1 {SELECT {[Liste1]} CASE "3case" THEN 1<br> ENDCASE CASE "1" THEN 2 ENDCASE DEFAULT Default<br> a moi ENDDEFAULT
ENDSELECT} ENDCASE CASE "1" THEN 2 ENDCASE DEFAULT Default<br> a moi ENDDEFAULT
ENDSELECT}
So in fact the <br> can/should be removed between THEN and ENDCASE (and DEFAULT and ENDDEFAULT) but ONLY if the <br>s are within a {SELECT...ENDSELECT}, and within that the normal rules should apply...
Am I as clear as mud?
Any help or abuse most appreciated!
Cheers
Anton