Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道 [^9] 和 [^1-9] 在正则表达式中是允许的,但我在编译相反的情况时遇到了麻烦:
^(<\?php[\w\W]*\?>/);
任何人都可以帮忙吗?
如果您使用与 perl 兼容的正则表达式语法(您可能是,尽管您没有指定您的平台),该(?!)构造可以做到这一点。也就是说,“a(?!b)”将匹配“ac”,但不匹配“ab”。
(?!)