Regular Expressions 101

Community Patterns

Community Library Entry

-1

Regular Expression
PCRE2 (PHP >=7.3)

/
^[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?$
/
gm

Description

pattern to validate a slug with numbers

Submitted by mestri.rodrigo - 2 years ago