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.
仍然习惯于正则表达式中的环视,但似乎无法获得
\b(?>! key)foreign\b
成为正确的解决方案?我试图在某些文本中查找单词 foreign 的所有实例,但不是外键或外键。
怎么样:\bforeign(?!\s?key)\b
\bforeign(?!\s?key)\b
示例:http ://regexr.com?343k9
前瞻需要在之后foreign(并且您不需要>):
foreign
>
\bforeign(?! key)\b
单词边界将处理这种foreignkey情况。
foreignkey