Regular Expressions 101

Community Patterns

Match a string with optional trailing punctuation

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^.*[.!?]?$
/
gm

Description

Submitted by anonymous - a month ago