I have the following string...
Out with the <_link>user://1|Team GB for
<_link>tag://FridayBeers|#FridayBeers
And I have written the following regex which strips out the tags and characters.
~<(/){0,1}.*?( /){0,1}>|(tag://\w*\||user://[0-9]*\|)~
However what I now need to achieve is the following
<_link>user://1|Team GB gets converted to <a href="user/1">Team GB</a> and for <_link>tag://FridayBeers|#FridayBeers to <a href="tags/FridayBeers">#FridayBeers</a>
Can some post an answer that changes my regex to allow for this I am using PHP;
$post_text = "Out with the <_link>user://1|Team GB for <_link>tag://FridayBeers|#FridayBeers";
$pattern = "~<(/){0,1}.*?( /){0,1}>|(tag://\w*\||user://[0-9]*\|)~"; //"~<(/){0,1}.*?( /){0,1}>|(tag://\w*\||user://[0-9]\|)~";
$replacement = " ";
$regexd = preg_replace($pattern, $replacement, $post_text);