$pattern = "/\[url\=(.*)\](.*)\[\/url\]/i";
My pattern above rewrites bbcode to html but I want to exclude links from my own domain. Is it possible to modify the regex so it will work for all external links but not for links with my own domain?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Whenever you want to do something like that you normally use the
preg_replace_callbackfunction.It allows you to specify a callback function that can check further conditions prior offering the replacement string which allows to “replace” with the same so no replacement is done.