Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^(?!.* {2})(?=\S)(?=.*\S$)[a-zA-Z0-9- &]{2,100}$
/
g

Description

No trailing spaces or extra spaces max char 200 min 2 and hyphen and & only allowed

Submitted by Natalia zolotareva - 3 years ago