Following on from this question I asked yesterday:
http://stackoverflow.com/questions/3519549/can-i-shorten-this-regular-expression
The solution was to use the following expression:
^([a-z]{5}-){4}[a-z]{5}$
To check for a match for a string with the following format:
aBcDe-fghIj-KLmno-pQRsT-uVWxy
I was advised to omit the A-Z from my original query and make the Regular Expression case insensitive in the code that uses it. For example, specify RegExOptions.IgnoreCase in the constructor for the RegEx in C#.
Is there any reason why this should be done in code rather than the regular expression itself?
I think this question is valid enough to warrant a new question rather than continuing the discussion in yesterday's.