Menu
I have a regular expression that is used to find the BB code of a url within a string and replace it with an A tag. It works, however I am having a problem when there are two or more occurrences of the [Url] tag. I think it has something to do with the variables within the regular expression. I am not very familiar with it and could do with some help.
This is the regular expression at present:
[code=php]$string = preg_replace(‘/([URL=)(.+)(])(.+)([/URL])/’, ‘<a href=”\2″ target=”_blank”>\4</a>’, $string);
Thanks in advance
Ben