Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-09-22 09:52
Flavor·PCRE (Legacy)

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

Description

This expression matches first and last character as well as check for the string if length is 1 or not if it is simply check the first character.

Submitted by anonymous