Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?:(([\d\p{L}\-_$&+:;=?@#|!\.]+ )*[\d\p{L}\-_$&+:;=?@#|!\.]+)++,)*+(([\d\p{L}\-_$&+:;=?@#|!\.]+ )*[\d\p{L}\-_$&+:;=?@#|!\.]+)++$
/
gm

Description

Validate comma-separated list of values (allowed: words; digits; special characters; single non-trailing non-leading spaces;)

Submitted by anonymous - a year ago