I am coding a bbcode parser system. But I'm stuck with the nested tags.
I would like to know if someone know the regex pattern to find for instance a [url] tag.
Example: [url][url]Hello world .com[/url][/url].
I want the output for this to be <a>[url]Hello world .com[/url]</a> where [url]Hello world.com [url/] becomes clickable.
Please not that "[url][url]Hello world[/url][/url] [url]Hello again .com[/url]" can occure and all other combinations are also possible.
If you have a better idea than doing this with regex, please let me know :)
Here's my normal regex pattern:"#\[url\](.*)\[\/url\]#isU"
//this is making the output <a>[url]Hello world .com</a>[/url], and it's logical but how to fix it ?
Thank you