Regular Expressions 101

Community Patterns

Reverse list of ASN.1 OIDs/Short Names/Long Names for X.509 certificates under OpenSSL


Regular Expression
PCRE (PHP <7.3)

(.*) ([\w\d\.\-\(\)]+) (\d(?:\.\d+){2,}$)


OIDs are just numbers in the format Short names are alphanumeric, contiguous descriptions (no spaces, hyphens allowed) Long names can be basically everything (sometimes even UTF-8!)

Sometimes, organisations providing the list of 'their' OIDs might reverse the order, for listing a directory reference (look up the name, then figure out what OID it is being assigned to). This regexp captures this 'reverse directory' scheme and rewrites everything properly for OpenSSL.

Submitted by Gwyneth Llewelyn - a year ago