Regular Expressions 101

Community Library Entry

12

Regular Expression
ECMAScript (JavaScript)

/
^[a-zA-ZçÇığĞİöÖşŞüÜ]+(?:\s[a-zA-ZçÇığĞİöÖşŞüÜ]+)+$
/

Description

Matches case insensitive first name, optional unlimited number of middle names and last name separated with space format. Replaced \w with explicit char range for Turkish support. (Äž accepted as first char not to over complex)

Submitted by CKK - 10 years ago