Mik*_*lla 3 regex expressionengine
我如何编写一个正则表达式,该表达式匹配任何包含该段"articles"后跟任何其他段的URL,但是不匹配该段的URL "articles-main"?
所以它会匹配这些:
www.mysite.com/articles
www.mysite.com/articles/tinman
Run Code Online (Sandbox Code Playgroud)
但不是这些:
www.mysite.com/articles-main
www.mysite.com/articles-main/tinman
Run Code Online (Sandbox Code Playgroud)
如果重要的话,这适用于ExpressionEngine.
使用所谓的负前瞻:
articles(?!-main)
Run Code Online (Sandbox Code Playgroud)
或者更准确地说:
mysite.com/articles(?!-main)
Run Code Online (Sandbox Code Playgroud)