I'm having trouble with two regular expressions that I need to use to validate url
s in an xsd
file.
I understand that there is a slight difference in how Schema
uses regex compared to other systems.
Does anyone have any valid regex to separately validate a url
and an email
in XSD
schema?
For e-mail :
<xsd:pattern value="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}"/>
Not that xsd schema always implies anchors so this should have to match your entire string.
Edit : Above regex is pretty basic. I suggest you read this :
Using a regular expression to validate an email address
For more info. Regarding the url, depending on how complex you want your validation to be there are about a million regexes you could use. And schema regex is rather limited to say the least.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.