1

我正在使用 Smack 库,据我所知,没有用于验证用户 jid 的功能,该功能用于创建新连接。(如果我错了请纠正我)

所以我决定写一个新的,为此我开始研究RFC-6122,它包含带有验证规则的 ABNF 块。

不幸的是,我不太了解非常 Unicode 特定的东西和 BNF 相关的东西,所以我不明白如何根据这个 BNF 块制作正确的正则表达式。特别是我对 ABNF 块中提到的“stringprep 的 Nodeprep 配置文件”之类的东西感到困惑。

您能否澄清一下或给我一些建议?

4

1 回答 1

1

It's defined in RFC 6122, Appendix A, but that's unlikely to help you without also reading RFC 3454, and a bunch of other source material. It's quite an undertaking to implement, so I strongly suggest you use an existing Stringprep library, such as libidn.

于 2013-04-08T14:56:21.133 回答