Skip to content

Instantly share code, notes, and snippets.

@jgornick
Last active November 5, 2021 19:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jgornick/466447572cdc89e6fc9d to your computer and use it in GitHub Desktop.
Save jgornick/466447572cdc89e6fc9d 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/2010/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