【发布时间】:2019-05-07 20:19:17
【问题描述】:
我想用一个简单的预处理选项来扩展 Markdown 的语法。
当文本在方括号中包含一些单词,但后面没有括号时:
Example text with [some reference] to show.
我想扩展它,使它成为一个自引用链接:
Example text with [some reference](some-reference.html) to show.
创建结果本身是我可以自己做的事情,但我不知道,我如何才能只匹配这些表达式:
A word [and more] in the text. // this matches
A word [and more](stackoverflow.com) in the text. // this doesn't
【问题讨论】:
-
@shadoe2020 似乎都按我的预期工作,非常感谢!
-
您介意我将其作为答案发布并且您可以选择它,因为它对您有用吗?
-
我当然不知道,谢谢!
标签: javascript regex markdown regex-greedy