<?php $text = "[url=https://test.com]my link[/url]"; echo preg_replace('~\[url=([^][\s]+)]([^][]*)\[/url]~', "<a href='$1' target='_blank'>$2</a>", $text) . PHP_EOL; echo preg_replace('~\[url=([^][\s]+)](.*?)\[/url]~s', "<a href='$1' target='_blank'>$2</a>", $text);
You have javascript disabled. You will not be able to edit any code.