Skip to content

Instantly share code, notes, and snippets.

@MrDesjardins
Last active December 13, 2022 03:24
Show Gist options
  • Save MrDesjardins/222d9842712a2f822c8a28a761c152a3 to your computer and use it in GitHub Desktop.
Save MrDesjardins/222d9842712a2f822c8a28a761c152a3 to your computer and use it in GitHub Desktop.
Some Regex for MDX to find potential issues
# MDX validations
## Title Format with quote
title: "(.*)(\\.*)"
## Ensure date is yyyy-mm-dd
(date: )(?!("((20[012]\d|19\d\d)|(1\d|2[0123]))-((0[0-9])|(1[012]))-((0[1-9])|([12][0-9])|(3[01]))"))
## Scan to see if we have all the code block starting a line with tripple `
^(?!```).+(```)+.+$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment