Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2021-07-13 11:18
Flavor·JavaScript

/
(^[A-Z])([^.!?]*)([.!?])$
/
Open regex in editor

Description

it starts with a capital letter; it ends with a full stop, question mark or exclamation point ('.', '?' or '!'); full stops, question marks and exclamation points don't appear anywhere else in the sentence.

Submitted by Hafiz