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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -