Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
((\s|^|\/|\(|\,)(M\.?\s*D\.?)(\s|$|\/|\)|\,)|(\s|^|\/|\(|\,)(D\.?\s*O\.?)(\s|$|\/|\)|\,))
/
gim

Description

This will identify M.D.'s and D.O.s, regardless of punctuation (within reason) and exclude similar matches (e.g., DMD)

Submitted by anonymous - 10 years ago