It's my first question in the forum, so if I do something wrong I apologize in advance. I was trying to do an XSD exercise where the address element must be made up of any set of letters, then a blank space and finally a number between 1 and 200. For this I have to use the "pattern" constraint and talking about it with a colleague we thought of putting it like this:
<xsd:element name="direccion">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="[a-z]*\b(200)|(1[0-9][0-9])|([1-9][0-9])|([1-9])"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>`
The problem is that it would not be quite right and also the validator gives me an error, I do not know if you would know how to change it so that it complies with the norm and does not give an error. Thank you very much.
Regular expressions in XSD have some limitations: They don't support
^
,$
,\b
or lookahead to mention a few.Try with:
.* (200|1?[0-9]{2}|[1-9])