Regular Expressions 101

Names from Wikipedia List

Open Workspace
  • .NET 10.0 (C#)
  • Match
0

Regular Expression

@"
^(([[a-zA-Z\p{L}\.\-']{1,30})(\s))(([a-zA-Z\p{L}\.\-']{1,30})(\s))?([[a-zA-Z\p{L}\.\-']{1,30})(\s)?(\([a-zA-Z\p{L}\.\-'\s]{1,50}\))?$
"
gm

Description

Matches all names in a Wikipedia List, excluding names with suffixes (eg. Jr., III, PhD, etc.) or multiple middle names.

Submitted by Brian Kozub