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[ac-iklo-z]{5}\b"
"\b[ac-iklo-z]{5}\b"
您可以使用/\b[^bjmn\W]{5}\b/i对其中不包含 bjmn 的五个字母单词进行不区分大小写的匹配。
/\b[^bjmn\W]{5}\b/i
您还需要指定要匹配大写字母,我不确定语法,但是“/b[ac-iklo-zAC-IKLO-Z]{5}/b”