我想匹配ABC的*ABC*,而不是从**ABC**.
我到目前为止这个;
/[^\*]{1}\*([^\*]+)\*[^\*]+/
Run Code Online (Sandbox Code Playgroud)
要匹配的字符串可以是以下任何一种.
ABC **Don't match this** DEF
ABC *Match this* DEF
*Match this*
**Don't match this**
(?<!\*)\*ABC\*(?!\*)
Run Code Online (Sandbox Code Playgroud)
其中读出的是
*ABC*不是先于*,而不是成功*.