xsd - I am finding difficult to write a regular expression for a location element in xml schema -
location element needs accept "city, state" data(for exampler: topsail beach, nc), ending errors. me? here code snippet.
<xs:element name="location" minoccurs="0" maxoccurs="1"> <xs:simpletype> <xs:restriction base="xs:string"> <xs:pattern value="[a-za-z]*[ ]?[a-za-z]*,[ ]?[a-za-z]*"/> </xs:restriction> </xs:simpletype> </xs:element>
regular expression string entry should in "city, state"
format :
[a-za-z ]*, [a-za-z]*
it matches sample text provided i.e topsail beach, nc
Comments
Post a Comment