Floyd R Turbo
Well-known member
I have a couple of easy ones.  These are "hanging chads" from a conversion that I never caught and never got back to.
I have the following instances of code related to old animated smilies
This one is a broken path (not a full URL)
	
	
	
		
This one is the full IMG code link
	
	
	
		
and I need to change these to
	
	
	
		
The filename is not relevant, it's only this
	
	
	
		
that needs to change to this
	
	
	
		
It's easy to fix with
Quick
	
	
	
		
Reg
	
	
	
		
repl
	
	
	
		
But that also catches the "broken" ones in a way that makes them difficult to then pinpoint - i.e. I have to look for /data/emoticons that is not part of a larger URL.
So I figure if I first fix the full URLs, all that will be left will be the broken ones.
I need the regex then for matching this
	
	
	
		
and changing it to this
	
	
	
		
where ABCDEFG is one of many .gif filenames like sad, biggrin, wink, angry, cry, blink, rolleyes, etc.
Which I THINK is this
	
	
	
		
and sub this
	
	
	
		
				
			I have the following instances of code related to old animated smilies
This one is a broken path (not a full URL)
		Code:
	
	/DesktopModules/ActiveForums/themes/_default/emoticons/biggrin.gif
	This one is the full IMG code link
		Code:
	
	[IMG]http://www.myforum.org/DesktopModules/ActiveForums/themes/_default/emoticons/whistling.gif[/IMG]
	and I need to change these to
		Code:
	
	[IMG]http://www.myforum.org/data/emoticons/whistling.gif[/IMG]
	The filename is not relevant, it's only this
		Code:
	
	/DesktopModules/ActiveForums/themes/_default/emoticons
	
		Code:
	
	/data/emoticons
	It's easy to fix with
Quick
		Code:
	
	emoticons
	
		Code:
	
	/\/DesktopModules\/ActiveForums\/themes\/_default\/emoticons/i
	
		Code:
	
	/data/emoticons
	But that also catches the "broken" ones in a way that makes them difficult to then pinpoint - i.e. I have to look for /data/emoticons that is not part of a larger URL.
So I figure if I first fix the full URLs, all that will be left will be the broken ones.
I need the regex then for matching this
		Code:
	
	[IMG]http://www.myforum.org/DesktopModules/ActiveForums/themes/_default/emoticons/ABCDEFG.gif[/IMG]
	
		Code:
	
	[IMG]http://www.myforum.org/data/emoticons/ABCDEFG.gif[/IMG]
	Which I THINK is this
		Code:
	
	(\[IMG\]http:\/\/www\.myforum\.org)\/DesktopModules\/ActiveForums\/themes\/_default\/emoticons(\/[\w\-]+\.gif\[\/IMG\])
	
		Code:
	
	\1/data/emoticons\2