>If you need to limit the total characters to 20 you will need to use a look ahead expression, for example:
>
>^(?=(([A-Z0-9]){1,20})-(([A-Z0-9]){1,12})).{1,20}$
>
>paste that expression in regex tester and you'll see that all of this lines get validated:
>
>A-B
>0-B
>ABC0000-DEF000000000
>1E-1C
>A1-B2
>1234567890123456-DEF
>12345678901234567-01
>AA-AB
>12E345678901-A
>
>But as soon as you go out of the 20th char (total) they will not get validated (you can play with {1, 20} to see how it changes.
>
>Quickly googling I found
this tutorial that I think explains lookahead (and lookbehind) quite well
Thanks, this is very good.