Skip to content

Instantly share code, notes, and snippets.

View tadcos29's full-sized avatar

TGC tadcos29

View GitHub Profile
@tadcos29
tadcos29 / DOIRegexTutorial.md
Last active September 2, 2025 09:19
A small tutorial on regex using the DOI format as example.

Simple Regex Tutorial - DOI Edition

The DOI, or Digital Object Identifier, is a unique string created according to a standardised scheme, which can be assigned to any object and subsequently used to identify or track it. The adjective 'digital' here qualifies 'identifier', not 'object' - one could theoretically pin a DOI on absolutely anything: digital, physical or ephemeral - but in practice the ambiguity resolves itself, as DOIs depend on digital search for much of their usefulness. Most people are likely to encounter DOIs as references to academic journal articles, but over the years they have been assigned to quite a few interesting entities; for example, the NASA Planetary Systems Table, a regularly-updated collection containing the parameters of known exoplanets and their stars, bears the DOI of 10.26133/NEA12.

Given their ubiquity, it's useful to be able to validate DOIs using regular expressions, which in turn makes them a useful starting point for a basic regex tutorial.

Summary

The DO