>([A-Za-z0-9]{1,18})-([A-Za-z0-9]{1,18}) is probably more accurate, but I can't say for sure. My assumption is that it is supposed to be 1 or more alphanumeric characters, followed by a single hyphen, followed by 1 or more alphanumeric characters. If there has to be 1 or more characters before and after the hyphen and the length is known to be 20, the other side can have at most 18 characters.
That's probably what it should be. This mask was sent to me on a test item. So, maybe it hasn't been fully tested.
Thanks for the additional explanations
>Also, while the expression could match a string up to 41 characters long (37 in the revision), if you know the max length is 20, the additional characters aren't going to matter. If you couldn't make this assumption the regex becomes much more complicated if you try to ensure that it is a specific size and has exactly 1 hyphen at an unknown position in the string.
Ok