Resource icon

Post Content Find / Replace 1.0.0

No permission to download
If you prefer to use the addon it would like this, although I'm not sure if that was just an example YouTube video? Because that YouTube URL is not valid and as far as I know valid YouTube video IDs have to be 11 characters and can't contain question marks.

Quick Find:
Code:
MEDIAyoutube

Regular Expression:
Code:
#\[MEDIAyoutube\]([\w\-\?]{10})\[\/MEDIA\]#

Replacement String:
Code:
[MEDIA=youtube]\1[/MEDIA]
 
Anyone have the code for
Code:
[img width=449 height=480]
and need it to be
Code:
[IMG]
I did an SMF > phpBB > Xenforo move

Would this be correct??????

Quick Find:
Code:
[img
Regular Expression:
Code:
#\[img width=[^>]+>(<param[^>]+></param>)
Replacement String:
Code:
[img]
 
Anyone have the code for
Code:
[img width=449 height=480]
and need it to be
Code:
[IMG]
I did an SMF > phpBB > Xenforo move

Would this be correct??????

Quick Find:
Code:
[img
Regular Expression:
Code:
#\[img width=[^>]+>(<param[^>]+></param>)
Replacement String:
Code:
[img]

Quick Find:
Code:
[img

Regular Expression:
Code:
#\[img [\w\=\ ]{0,}\]([\w\:\/.]{0,})\[\/img]#

Replacement String:
Code:
[img]\1[/img]
 
Last edited:
untested off the top of my head, let me know if you have problems
edited my post above to show bbcode instead of embedding it...hope that helps someone answer my question

Quick Find:
Code:
youtube

Regular expression:
Code:
#\[url=[^\.]+\.youtube.com[^?]+\?v=([a-z0-9_-]{11})'](?:.*?(?!\[/url]?).)(?:\[/url])#siu

Replacement String:
Code:
[media=youtube]\1[/media]
 
untested off the top of my head, let me know if you have problems


Quick Find:
Code:
youtube

Regular expression:
Code:
#\[url=[^\.]+\.youtube.com[^?]+\?v=([a-z0-9_-]{11})'](?:.*?(?!\[/url]?).)(?:\[/url])#siu

Replacement String:
Code:
[media=youtube]\1[/media]

Thanks for the quick reply. That worked for the example I posted, but not for any other youtube link. Here's another example that did not convert:

[URL='http://www.youtube.com/watch?v=3FR72wHHCeM']10 GHz: An Introduction to X-Band for Amateur Radio - YouTube[/URL]
 
This should work as long as there aren't any extra parameters in the youtube URL

Quick Find:
Code:
[URL='http://www.youtube.com

Regular Expression:
Code:
#\[URL='http:\/\/www.youtube.com\/watch\?v=([\w\-]{11})'\][\w\: -]{0,}\[\/URL\]#

Replacement String:
Code:
[MEDIA=youtube]\1[/MEDIA]
 
This should work as long as there aren't any extra parameters in the youtube URL

Quick Find:
Code:
[URL='http://www.youtube.com

Regular Expression:
Code:
#\[URL='http:\/\/www.youtube.com\/watch\?v=([\w\-]{11})'\][\w\: -]{0,}\[\/URL\]#

Replacement String:
Code:
[MEDIA=youtube]\1[/MEDIA]

Thanks for the help, but that didn't even find the last example I posted :(
 
Thanks for the quick reply. That worked for the example I posted, but not for any other youtube link. Here's another example that did not convert:

[URL='http://www.youtube.com/watch?v=3FR72wHHCeM']10 GHz: An Introduction to X-Band for Amateur Radio - YouTube[/URL]
I couldn't tell you why it would not apply other than human error on your end...

gdfgfds.webp
 
I'm having trouble with these guys

Code:
[URL]http://www.marca.com/?d=74FPEVFL[/URL]
[URL='http://www.marca.com/es/?d=CO980GLE']Capítulo 1:El Autobot Spike[/URL]
[URL='http://www.marca.com/es/?d=QOSC74G7']Capítulo 2:Cambiando a Gears[/URL]
[URL='http://www.marca.com/?d=M138WOTQ']Capítulo 3: La ciudad de acero[/URL]
[URL='http://www.marca.com/es/?d=6YRNO71Z']Capítulo 4:El ataque de los Autobots [/URL]

So far this is what I've trid with no luck

Quick Find:
Code:
marca

Regular expression:
Code:
#(\[URL)(])(http://www.marca.com/\?d=)([^]]+)(\[/URL])#siu

Replacement String:
Code:
\1='\3\4'\2Link Removed\5


Quick Find:
Code:
marca

Regular expression:
Code:
#(?:\[URL='http://www.marca.com/\?d=[^']+'])((?:.*?(?!\[/URL]?)).)(?:\[/URL])#siu

Replacement String:
Code:
\1
 
Top Bottom