Javascript code replace help

General questions about using WildEdit

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

Post Reply
Karbon
Posts: 2
Joined: Tue Dec 28, 2004 5:43 pm

Javascript code replace help

Post 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!
--
- Mitchell
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post 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?
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
bbadmin
Site Admin
Posts: 878
Joined: Mon Feb 17, 2003 8:54 pm
Contact:

Post 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
Karbon
Posts: 2
Joined: Tue Dec 28, 2004 5:43 pm

Post 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..
--
- Mitchell
Post Reply