Skip to content

Instantly share code, notes, and snippets.

@mindfulmike
Forked from jgornick/regex.txt
Last active March 29, 2016 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mindfulmike/67c8a0d28a59c81eb691e45f9e49947a to your computer and use it in GitHub Desktop.
Save mindfulmike/67c8a0d28a59c81eb691e45f9e49947a to your computer and use it in GitHub Desktop.
RegEx: US Medicare Number Validate and Match
# Accepted formats are 0-3 alpha, 9 digits, and 1-3 alpha-numeric with or without spaces and dashes:
# * AAA-000-00-0000-AAA
#
# http://survivinghealthinsurance.com/post/114021224748/medicare-id-numbers-suffixes-and-prefixes
/^([a-z]{0,3})[-\s]?(\d{3})[-\s]?(\d{2})[-\s]?(\d{4})[-\s]?([0-9a-z]{1,3})$/i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment