[英]Regex match lines with no more than a certain number of specific characters?
[英]PHP Regex match full stop after certain number of characters
我不知道如何用正则表达式来做到这一点。 我想在句子中一定数量的字符后匹配句号。
this is a long sentence. it contains a few full stops in it. I want to match the full stop after the halfway point.
this sentence is shorter. it also contains full stops but not many.
它也不应该与最后一个句号匹配。 它应该与第一句中的第二个句号匹配,而在第二句中没有匹配。 所以比赛应该是这样的:
this is a long sentence. it contains a few full stops in it[.] I want to match the full stop after the halfway point.
this sentence is shorter. it also contains full stops but not many. [no match]
有没有办法做到这一点? 我有一些类似的东西根本不起作用:
/[.]{20,}/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.