Rexact
Cheatsheet

Regex ORCID identifier

An ORCID isn't just "16 digits": the final check character can be an "X" (computed per ISO 7064 MOD 11-2), a full standard that none of the attempts found online actually verify. More surprising: ORCID's own official Angular library contains a publicly reported regex bug - a missing start anchor lets an invalid prefix slip in front of an otherwise correct identifier. Here's a pattern that at least checks the full structure, compared against that buggy official regex and two other attempts.

/^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]$/
passes 22/22 cases

Comparison of existing patterns

Implementation

const re = new RegExp("^\\d{4}-\\d{4}-\\d{4}-\\d{3}[0-9X]$", "");
re.test(input);

Limits

  • Valide seulement la FORME (16 caractères groupés par 4) : ne calcule pas la clé de contrôle ISO 7064 MOD 11-2 — un identifiant syntaxiquement valide selon ce motif peut avoir une clé fausse et ne correspondre à aucun chercheur réel.
  • Ne consulte pas le registre public ORCID (pub.orcid.org) : seule une requête à l'API officielle confirme qu'un identifiant est réellement attribué et actif.
  • N'accepte pas le préfixe URL parfois utilisé pour citer un ORCID (« https://orcid.org/0000-0002-1825-0097 ») : ce motif valide l'identifiant nu, pas sa forme complète en citation.
  • Le caractère de contrôle final est sensible à la casse dans ce motif (« X » majuscule uniquement) : un « x » minuscule est parfois accepté par des bibliothèques tierces, dont un bug réel signalé dans l'outil Angular officiel d'ORCID lui-même.