I am trying to find regex pattern in XSD that allow both positive and negative integers
My current code allows only positive integers.
xs:pattern value="[0-9]{0,10}"
Using the \d
notation would make it even simpler:
xs:pattern value="-?\d+"
Assuming you only mention an optional negative sign in front of the number:
xs:pattern value="-?[0-9]{0,10}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With