Closed retokromer closed 5 years ago
No, my bad, this matches probably [A-Z0-9]{7}
as well…
This should be fine for the lossy variant:
\b[A-Z0-9]{6}(?:[A-Z0-9]{2})?\b
but it’s not really a more elegant regex…
Or shorter (and harder to maintain ;-)
\b(?:[A-Z0-9]{2}){3,4}\b