Find and replace URLs from [PHP] and [CODE] tags
Defender Offline
Junior Member
**
Posts: 2
Joined: Nov 2014
Post: #1
Find and replace URLs from [PHP] and [CODE] tags
I am trying to find and replace any type of URL from `code` and `php` tags. I tried this code;

Code:
1
2
3
4
5
6
$plugins->add_hook("parse_message", "plugin_parse_message");
function plugin_message(&$message)
{
	$error_message_link = 'HIDDEN LINK';
	$message = preg_replace("~(?:https?://)?(?:www\.)(?:[^.\s]+)(?:\.[^.\n\s]+)*\.\w{2,4}(?=(?:(?!\[/?(?:code|php)])[\S\s])*\[/(?:code|php)])~m", "{$error_message_link}","{$message}");
}


but it does nothing at all. Please help me to find a correct REGEX

(This post was last modified: 11-01-2014 11:21 PM by Defender.)
11-01-2014 11:20 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Find and replace URLs from [PHP] and [CODE] tags - Defender - 11-01-2014 11:20 PM

 Standard Tools
Forum Jump: