Skip to content

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

@pawajee

Description

@pawajee

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions