Page 1 of 1

Javascript code replace help

Posted: Tue Dec 28, 2004 5:46 pm
by Karbon
I'm trying to replace this block of code on a website tree of mine and am having some strange problems. If I load a test file from the directory that I'm searching and do a test find it works well, but when I hit Replace All it doesn't replace anything - even in the test file!

What I'm trying to replace (actually, remove) :

Code: Select all

   <script language="javascript" src="http://track.roiservice.com/track/track.aspx?ROIID=12345"></script>
	<script language="javascript">
	if (typeof(ROIID) + '' != 'undefined')
	{
		TrackEvent('LandingPage', 0);
	}
	</script>
I wasn't using a regex as the literal block of text seemed to work in the test searching. Please let me know if I'm doing something wrong!

Thanks!

Posted: Tue Dec 28, 2004 8:07 pm
by s_reynisson
The Folder pane set to the correct folder?
You've ticked "Search subfolders" if needed?
"In files matching" using the correct wildcards?

Posted: Wed Dec 29, 2004 8:25 am
by bbadmin
Perhaps the line terminators in your files are not carriage return and linefeed? In that case, you'll need to use a regular expression.

An indeterminate number of end of line characters can be matched with [[:space:]]* (or "\b"), and it will be necessary to escape all instances of ?*(){} with \.

Keith MacDonald
Helios Software Solutions

Posted: Wed Dec 29, 2004 6:27 pm
by Karbon
Ok, I'll give it a try. Still strange that the "test search" finds the block in any test file I load without the regex..