Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^([\u00C0-\u017Fa-zA-Z]{2,}(?:[-]?[\u00C0-\u017Fa-zA-Z]{2,}))$
/
gm

Description

First name validator - minimum 2 characters, optional hyphen, 2 or more characters

Submitted by Jeff Zinn - 3 years ago