Skip to content

Instantly share code, notes, and snippets.

@smeech
Last active January 31, 2025 16:01
Show Gist options
  • Select an option

  • Save smeech/fab7459c7c703659b7df3fc8e2b57649 to your computer and use it in GitHub Desktop.

Select an option

Save smeech/fab7459c7c703659b7df3fc8e2b57649 to your computer and use it in GitHub Desktop.
[Ordinal suffixes] Superscript suffixes of ordinal numbers with some checking for validity. #espanso #regex
# Espanso superscript suffixes of ordinal numbers with some checking for validity
matches:
- regex: (?P<number>\s[1]|[0,2-9]1)st
replace: "{{number}}ˢᵗ"
- regex: (?P<number>\s[2]|[0,2-9]2)nd
replace: "{{number}}ⁿᵈ"
- regex: (?P<number>\s[3]|[0,2-9]3)rd
replace: "{{number}}ʳᵈ"
- regex: (?P<number>\s[0,4-9]|[1][\d]|[0,2-9][0,4-9])th
replace: "{{number}}ᵗʰ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment