jsonix-schema-compiler icon indicating copy to clipboard operation
jsonix-schema-compiler copied to clipboard

xs:pattern does not work and want to me to ascpe '-' char

Open pawajee opened this issue 3 years ago • 0 comments
trafficstars

I have following regex validation:

<xs:simpleType name="email_address">
	<xs:restriction base="xs:string">
		<xs:maxLength value="255"/>
		<xs:pattern value="[_a-zA-Z0-9-+]+(\.[_a-zA-Z0-9-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4})"/>
	</xs:restriction>
</xs:simpleType>

and getting the below error:

[ERROR] InvalidRegex: Pattern value '[_a-zA-Z0-9-+]+(.[_a-zA-Z0-9-+]+)@[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)(.[a-zA-Z]{2,4})' is not a valid regular expression. The reported error was: ''-' is an invalid character range. Write '-'.'. line 2559 of file:/D:/temp/XSDToJSON/xmls.xsd

[ERROR] org.hisrc.jsonix.execution.JsonixInvoker - The model is null, there was probably a problem parsing schemas.

pawajee avatar Feb 10 '22 08:02 pawajee