Community Patterns

Community Library Entry

0

Regular Expression
Created·2023-02-02 09:31
Flavor·PCRE2 (PHP)

/
^([a-b]).*\1$|^[a-b]{1}$
/
gm
Open regex in editor

Description

regex that will test string that begins and end with the same string character and also works if there is only one character in string

Submitted by Ananya