Page 1 of 1

Find The Beginning & End of Text and Replace with BLANK?

Posted: Sun Feb 27, 2011 8:54 pm
by jmca2000
Hi, Could someone Please Help me figure out how to change the following code?

Code: Select all

if (//abovePrice_292
                whiteLineAbovePrice_Y
				&& orangeLineAbovePrice_N
				&& yellowLineAbovePrice_N
				&& cyanLineAbovePrice_Y
				&& blackLineAbovePrice_N
				&& dodBlueLineAbovePrice_N
				&& blueLineAbovePrice_N
				&& greenLineAbovePrice_Y
				&& redLineAbovePrice_Y
			   )			
				{
				//abovePrice_292 = true ;
				DrawText("abovePrice_292" + DateTime.Now.Millisecond.ToString() + CurrentBar + DateTime.Now.Millisecond.ToString()
				+ CurrentBar + CurrentBar + DateTime.Now.Millisecond.ToString(), "A292", 0, Low[0]-(TickSize*13), Color.Black);
				Print("//abovePrice_292");
				Print("&& whiteLineAbovePrice_Y");
				Print("&& orangeLineAbovePrice_N");
				Print("&& yellowLineAbovePrice_N");
				Print("&& cyanLineAbovePrice_Y");
				Print("&& blackLineAbovePrice_N");
				Print("&& dodBlueLineAbovePrice_N");
				Print("&& blueLineAbovePrice_N");
				Print("&& greenLineAbovePrice_Y");
				Print("&& redLineAbovePrice_Y");
                }
TO:

Code: Select all

 if (//abovePrice_292
                whiteLineAbovePrice_Y
				&& orangeLineAbovePrice_N
				&& yellowLineAbovePrice_N
				&& cyanLineAbovePrice_Y
				&& blackLineAbovePrice_N
				&& dodBlueLineAbovePrice_N
				&& blueLineAbovePrice_N
				&& greenLineAbovePrice_Y
				&& redLineAbovePrice_Y
			   )			
				{
				//abovePrice_292 = true ;
				DrawText("abovePrice_292" + DateTime.Now.Millisecond.ToString() + CurrentBar + DateTime.Now.Millisecond.ToString()
				+ CurrentBar + CurrentBar + DateTime.Now.Millisecond.ToString(), "A292", 0, Low[0]-(TickSize*13), Color.Black);
				Print("//abovePrice_292");
				Print("&& whiteLineAbovePrice_Y");
				Print("&& cyanLineAbovePrice_Y");
				Print("&& greenLineAbovePrice_Y");
				Print("&& redLineAbovePrice_Y");
                }
I Just want to Delete the Lines that Start with Print and end with _N");

I have tried :

Find what: ^([ \t]*)(([Print]*)+[a-z]+)_N");
Replace with:

Thank You Very much in Advance!

Posted: Sun Feb 27, 2011 9:27 pm
by ben_josephs
Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: ^[ \t]*Print\(.+_N"\);\n
Replace with: [nothing]

[X] Regular expression

Replace All

Posted: Sun Feb 27, 2011 9:42 pm
by jmca2000
THANKs Ben, Worked Like a Charm!!!