Text Processingflags: g

Sentence Boundary

Matches sentence boundaries (punctuation followed by whitespace and a capital letter).

Try it in RegexPro

Pattern

regexJavaScript
/[.!?]\s+(?=[A-Z])/g

Raw source: [.!?]\s+(?=[A-Z])

How it works

`[.!?]` matches terminating punctuation. `\s+` matches whitespace. `(?=[A-Z])` is a lookahead for a capital letter (marks where the next sentence begins).

Examples

Input

Hello world. How are you? I'm fine!

Matches

  • .
  • ?

Common use cases

  • Sentence splitting
  • NLP preprocessing
  • Reading-level analysis

Related concepts