Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(?:(?<title>(?:[^\s\.]+\.){1}) +)*(?<first>\S+)(?: *(?<middle>[^,\n\r]+)*? +(?<last>[^,\s]+)*)*(?:, *(?<suffix>[^\n]+))*$
/
gm

Description

This raged parses out the Title (optional) Firstname Middlename(s) (optional) Lastname (optional) and Suffix (optional)

Submitted by anonymous - 3 years ago (Last modified 3 years ago)