This regex, /\[([^]]+)\]\((((?:https?|ftp):\/\/)?.*?)\)/gm, works fine in PCRE and Python, but not so much in javascript.
Why not? How do I fix it?
This regex, /\[([^]]+)\]\((((?:https?|ftp):\/\/)?.*?)\)/gm, works fine in PCRE and Python, but not so much in javascript.
Why not? How do I fix it?
Escaping ] inside [...] will make it work in Javascript:
\[([^\]]+)\]\((((?:https?|ftp):\/\/)?.*?)\)
^^
{abc}, others don't complain and just match {abc} literally.