i have this string
[url=test.php]test[/url]
or
[url=http://test.php]text[/url]
I want to a regex get this
[url=http://test.php]text[/url]
example:
before:
str = "[url=test.php]text[/url]"
str.gsub(/\[url=(.*?)\](.*?)\[\/url\]/,'[url=http://\1]\2[/url]')
=> "[url=http://test.php]text[/url]"
question:
str = "[url=http://test.php]text[/url]"
str.gsub(/\[url=(.*?)\](.*?)\[\/url\]/,'[url=http://\1]\2[/url]')
=> "[url=http://http://test.php]text[/url]"
so.. two "http://"
Any ideas anyone?
thanks