Please enable JavaScript to use this web application.
Regular
Expressions
101
Social
Donate
Info
Regex Editor
Community Patterns
Account
Regex Quiz
Settings
Order By
Most Recent
Most upvotes
Most downvotes
Highest Score
Lowest Score
Filter by Flavor
PCRE2 (PHP >=7.3)
PCRE (PHP <7.3)
ECMAScript (JavaScript)
Python
Golang
Java 8
.NET 7.0 (C#)
Rust
Sponsors
There are currently no sponsors.
Become a sponsor today!
Community Patterns
Search among 15,000 community submitted regex patterns...
There does not seem to be anything here
Community Library Entry
0
Regular Expression
PCRE (PHP <7.3)
/
^
(?!
[
\x20\x27\x2D
]
|
.
*
?
[
\p{Lu}
]
{2}
|
.
*
?
[
\x20
]
{2}
|
.
*
?
[
\x27
]
{2}
|
.
*
?
[
\x2D
]
{2}
|
.
*
?
(
\x20\x2D
|
\x2D\x20
)
|
.
*
?
(
\x27\x2D
|
\x2D\x27
)
|
.
*
?
(
\x27
[
\w
]
+
\x27
(
\x20
|
$
)
)
)
[
\p{L}\x20\x27\x2D
]
+
$
(?<!
[
\x20\x2D
]
)
/
gm
Open regex in editor
Description
Validates personal names.
Conditions:
Must contain only letters (any unicode letter), spaces, apostrophes and hyphens
Must not start with a space, an apostrophe or a hyphen
Must not contain consecutive uppercase letters
Must not contain consecutive spaces
Must not contain consecutive apostrophes
Must not contain consecutive hyphens
Must not contain a space before or after a hyphen
Must not contain an apostrophe before or after a hyphen
Must not contain enclosing apostrophes ('single quote' style)
Must not end with a space or a hyphen
Must contain at least one character
Submitted by
Mattias Larsson
-
8 years ago