嗨我在div中有以下文字:
[http://www.google.com Google this link] some other random text [http://example.com and another website] but don't parse [this is not a link, leave me alone].
Run Code Online (Sandbox Code Playgroud)
我试图做的是将链接转换为正常的HTML链接.格式总是这样,所以它打开[然后是网址,然后是链接文本,然后是关闭].但我只想匹配链接,而不是方括号中的所有文本.
我想.match()在javascript中使用函数来完成这个任务,但是我无法弄清楚正则表达式(我只需要链接的文本部分 - 其余部分应该是简单的拆分).
任何帮助都会受到影响.