var text = '[a url="vk.com"]vk[/a]' text = text.replace(/\[a url=(.*)](.*)\[\/a]/, "<a href=$1>$2</a>");