开发者

xml node name validation

I want to create regex which will validate xml node name. I have found grammar for names, but I don't know what some parts of it means. http://www.xml.com/pub/a/2001/07/25/namingparts.html

[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
[5] Name ::= (Letter | '_' | ':') (NameCha开发者_开发问答r)*

What does CombiningChar and Extender mean?

Thanks.


According to your spec I think this should do the trick:

(\w|_|:)(\w|\d|\.|-|_|:)*

That's without CombiningChar and Extender. In the official spec you can find what exactly is meant with CombiningChar and Extender (Ctrl+F for these on that page), you'd however have to translate the unicode codes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜