Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2024-06-04 08:12
Updated·2024-06-05 15:03
Flavor·PCRE2 (PHP)

/
^[a-zA-Z]\d[a-zA-Z\d]\.?([a-zA-Z\d]{0,4})?$
/
gm
Open regex in editor

Description

The regex should match ICD-10-CM codes, including those with the optional up to 4 characters suffix used in some codes.

NOTE: This regex assumes the letters can be mixed case.

Submitted by Richard Baxter