In an iOS app I have a identity card field. I want to show users the format. What the most appropriate/clear to describe the following regex:
[XYZ]{1}[0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKET]{1}
Currently I have:
Starting with 1 letter (X, Y, or Z), followed by 7 digits (0-9),
and ending with 1 letter (A, B, C, D, E, F, G, H, J, K, L, M,
N, P, Q, R, S, T, V, W, X, Y, or Z); without any other character
or space.
Considerations:
- How to indicate ranges of digits/letters, is
(0..9)
or(0 - 9)
better? - Should I write
(A-H, J-N, P-T, or V-Z)
(should I useor
here actually?) instead, or perhaps(A-Z except I, O or U)
? - Should I write
7 digits
orseven digits
, ... - ...
What's best in a situations like this?