正则表达式用于匹配方括号中没有括号的单词
RegEx for matching square bracketed words with no parenthesis following
我想用一个简单的预处理选项来扩展 Markdown 的语法。
当文本包含方括号中的一些词,但后面没有括号时:
Example text with [some reference] to show.
我想对其进行扩展,使其成为自引用 link:
Example text with [some reference](some-reference.html) to show.
创建结果本身是我自己可以做的事情,但我不知道,我怎样才能 完全匹配这些 表达式:
A word [and more] in the text. // this matches
A word [and more](whosebug.com) in the text. // this doesn't
\[(.*?)\]
第一次,第二次 \]\((.*?)\)
像这样
\[([^\[\]]*)\](?!\([^()]*\))
我想用一个简单的预处理选项来扩展 Markdown 的语法。
当文本包含方括号中的一些词,但后面没有括号时:
Example text with [some reference] to show.
我想对其进行扩展,使其成为自引用 link:
Example text with [some reference](some-reference.html) to show.
创建结果本身是我自己可以做的事情,但我不知道,我怎样才能 完全匹配这些 表达式:
A word [and more] in the text. // this matches
A word [and more](whosebug.com) in the text. // this doesn't
\[(.*?)\]
第一次,第二次 \]\((.*?)\)
像这样
\[([^\[\]]*)\](?!\([^()]*\))