开发者

XML Schema regex for integer range, excluding 0

I'm developing an XML schema and I need to restrict an integer to being within a ranger of -20 to 20, but not 0.

I was going to use minInclusive and maxInclusive for the -20 to 20.

I tried to add the regex "="^(?!0).+", but that does not appear to开发者_如何转开发 be a valid XML regex.

What value can I put in for xs:pattern that will prevent an integer from being 0?


Have you tried enumerating the legal values. Workable since the range is quite small.


Simple lack of escape character. The pattern value should have read "^(\?!0).+".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜