I have been provided with an XSD I am validating XML against. The XML is failing validation because the XSD is incorrect. I have one field that is meant to allow a 1 - 3 character string. The first character has got to be A, B, C or Z and may optionally be followed by upto 2 characters. I have not had much to do with regular expessions but have tried all manner of combinations to no avail.
The expression supplied is <xs:pattern value="([A,B,C,Z]{1}\w\?{2})"/>
Valid Examples of data are:
B
B6
BB
AB
Invalid:
G3
A B
6HC
Im sure its a fairly simple expression but I dont seen to be able to get it right!