RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 2
Title Test Details Pattern Title
Expression
^[a-zA-Z]+((\s|\-)[a-zA-Z]+)?$
Description
This regex validates a persons first name. Acceptable names include compound names with a hyphen or a space in them.
Matches
Bobbie Sue | Ana-Claire | BobbyJoe
Non-Matches
Billy - Joe | Billy Jr. | Thos.
Author Rating: Not yet rated. s l
Title Test Details Pattern Title
Expression
^[a-zA-Z]+((((\-)|(\s))[a-zA-Z]+)?(,(\s)?(((j|J)|(s|S))(r|R)(\.)?|II|III|IV))?)?$
Description
This regex validates a persons last name. Acceptable names can include compound names seperated by a hyphen or a space.
Matches
Jones, Jr | Casey-Jones | Casey-Jones, IV
Non-Matches
Jones, IV. | Jones , Jr | Casey-Jones-Hall
Author Rating: Not yet rated. s l
   Displaying page 1 of 1 pages; Items 1 to 2

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials