Regular Expressions 101

Community Patterns

1...45678...744

Regex fullname (auth-service)

0

Regular Expression
ECMAScript (JavaScript)

/
^\p{Lu}\p{L}*\s((\p{Lu}\p{L}*)+\s)*\p{Lu}\p{L}*$
/
gu

Description

  • Full name is at least 2 words
  • The words of full name are have uppercase character at the beginning and lowercase characters for the rest.
  • Between two words is just a space character.
  • Full name does not have space character at the beginning and the end of the string.
Submitted by anonymous - a year ago (Last modified a year ago)