Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(x|y).*\1$
/
gm

Description

This will match all strings starting and ending with the same letters that are specified in the capturing group (in the parentheses).

Submitted by @elliottprogrammer - 3 years ago