StupidBeauty
Read times:791Posted at:Tue Dec 17 19:18:03 2013
- no title specified

Jwt3.3.0文档翻译:类WRegExpValidator,Class WRegExpValidator

这个验证器,使用正则式来验证用户的输入内容。

这个验证器,会验证用户输入的内容是否符合指定的(perl风格)正则表达式。它会检查整个输入内容;不需要前缀^和后缀$

不支持以下perl 特性(因为客户端的验证代码无法处理它们):

  • •.不支持向前查找(Lookbehind),即,(?<=text)和(?<!text)这两种结构。

  • •.不支持原子分组(atomic grouping),即,(?>group)这种结构。

  • •.不支持条件表达式(conditional expressions),即,(?ifthen|else)这种结构。

使用示例

{

@code

WLineEdit lineEdit = new WLineEdit(this);

// 一个邮件地址验证器

WRegExpValidator validator = new WRegExpValidator(

"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}");

lineEdit.setValidator(validator);

lineEdit.setText("pieter@emweb.be");

}

注意 这个验证器不完全支持 unicode :它会对这个字符串的UTF8 编码结果进行匹配。

国际化

可通过覆盖以下本地化字符串值的方式来对这个类中使用的字符串进行翻译

未知美人

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands