Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?:(?!.{1,30}(?:\.\s|\.$|\?\s|\?$|;\s|;$|||))(?:.{30}))|(?:.{1,30}(?:\.\s|\.$|\?\s|\?$|;\s|;$|||))
/
gs

Description

Try to split at the longest point whereas sentences ended.

Submitted by anonymous - 5 years ago