Skip to content

Instantly share code, notes, and snippets.

@wadeschulz
Last active December 18, 2018 13:35
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 wadeschulz/2efc5fa477086dd7f13aa6f21ccaf658 to your computer and use it in GitHub Desktop.
Save wadeschulz/2efc5fa477086dd7f13aa6f21ccaf658 to your computer and use it in GitHub Desktop.
Python Regex to Preprocess Deidentified Sections of MIMIC-III Notes
regex1 = re.compile("\[\*\*(\d*\-\d*\-\d*)\*\*\]") # regex to remove special characters from shifted yyyy-MM-dd format
regex2 = re.compile("\[\*\*(\d*\-\d*)\*\*\]") # regex to remove special characters from shifted MM-dd format
regex3 = re.compile("\[\*\*(\d*)\*\*\]") # regex to remove special characters from shifted MM or dd format
regex4 = re.compile("\[\*\*[^\*]+\*\*\]") # regex to remove remaining de'id fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment