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!
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.