使用 python 验证 XMPP jid?
验证 xmpp jid 的正确方法是什么?语法描述这里:,但我不太明白。而且,它看起来相当复杂,因此使用库来完成它似乎是一个好主意。
我目前正在使用 xmpppy,但我似乎找不到如何用它验证 jid。任何帮助表示赞赏!
What is the correct way to validate an xmpp jid? The syntax is described here:, but I don't really understand it. Also, it seems pretty complicated, so using a library to do it would seem like a good idea.
I'm currently using xmpppy, but I can't seem to find how to validate a jid with it. Any help appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,当前 JID 的最佳参考是 RFC 6122。
我本来打算在这里给你正则表达式,但有点忘乎所以了,并实现了所有规范:
是的,这是很多工作。所有这一切都有充分的理由,但我们希望将来能够稍微简化一下,如果 précis 工作组取得成果。
First off, the current best reference for JIDs is RFC 6122.
I was just going to give you the regex in here, but got a little carried away, and implemented all of the spec:
Yes, this is a lot of work. There's good reasons for all of it, but we're hoping to simplify it in the future somewhat if the précis working group bears fruit.