admin管理员组文章数量:1400807
This is a Sentence which contains
Some capitalization errors.
So far I have this: (?<![.!?]\s)(?<!^)(?<!\sI\s)(?!I['’][a-z])(?!\b(?:Dr|Mr|Mrs)\.[\s\r\n])\b(?!I\b)[A-Z]\w*
It will find "Sentence" in the above. It avoids hitting on I and I' contractions, and Dr. / Mr. / Mrs.
What I can't get it to do is find "Some" in the above.
I feel maybe a second expression might be better for document scanning, as the first expression is quite long and probably not optimized.
I need the expression to be PCRE compliant that avoids non fixed width errors and such.
Just can't solve this on my own unfortunately. As expected AI is no help here... the best models struggle with regular expressions unless they are more simple.
Tried many different RegEx's to match the word "Some" in the above. It should NOT match a preceding line that ends with a period, question mark, or exclamation point. It should also NOT match on I and I' contractions, or on Dr. / Mr. / Mrs.
本文标签: regexCreating regular expression(s) which finds capitalization errorsStack Overflow
版权声明:本文标题:regex - Creating regular expression(s) which finds capitalization errors - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744202741a2595043.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论