Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^[A-Z]+(?:_{0,2}[A-Z]+)*$
/
gm

Description

HelloWorld -- NOT match HELLO_WORLD_ -- NOT match _HELLO_WORLD -- NOT match HELLO__WORLD -- match ]; -- NOT match RAGGA_DAFDASDA -- match RAGGA__DAFDASDA -- match HELLO#WORLD -- NOT match HELLO WORLD -- NOT match

Submitted by anonymous - 3 years ago