![](/img/trans.png)
[英]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.