uiautomator在UTF-8的编码方式下如何匹配英文和中文包括汉字
2016-12-07 08:30
726 查看
UiObject aa = new UiObject(new UiSelector().descriptionStartsWith("练与测"));
System.out.println("practice---"+aa.exists());
UiObject a = new UiObject(new UiSelector().descriptionMatches("^(\u0041)*[\u4e00-\u9fa5]+"));
System.out.println("A---"+a.exists());
UiObject b = new UiObject(new UiSelector().descriptionMatches("^(\u0042)*[\u4e00-\u9fa5]+"));
System.out.println("B---"+b.exists());
UiObject c = new UiObject(new UiSelector().descriptionMatches("^(\u0042)*[\u4e00-\u9fa5]+"));
System.out.println("C---"+c.exists());
UiObject d = new UiObject(new UiSelector().descriptionMatches("^(\u0041)*[\u4e00-\u9fa5]+"));
System.out.println("D---"+d.exists());
if(a.exists() || b.exists() || c.exists() || d.exists()){
System.out.println("this is choose");
}else{
System.out.println("this is write");
}
以上ABCD,就是判断标准,暂时没有发现startwith正确使用方法,哪位大神如果知道,烦请告知一下。
System.out.println("practice---"+aa.exists());
UiObject a = new UiObject(new UiSelector().descriptionMatches("^(\u0041)*[\u4e00-\u9fa5]+"));
System.out.println("A---"+a.exists());
UiObject b = new UiObject(new UiSelector().descriptionMatches("^(\u0042)*[\u4e00-\u9fa5]+"));
System.out.println("B---"+b.exists());
UiObject c = new UiObject(new UiSelector().descriptionMatches("^(\u0042)*[\u4e00-\u9fa5]+"));
System.out.println("C---"+c.exists());
UiObject d = new UiObject(new UiSelector().descriptionMatches("^(\u0041)*[\u4e00-\u9fa5]+"));
System.out.println("D---"+d.exists());
if(a.exists() || b.exists() || c.exists() || d.exists()){
System.out.println("this is choose");
}else{
System.out.println("this is write");
}
以上ABCD,就是判断标准,暂时没有发现startwith正确使用方法,哪位大神如果知道,烦请告知一下。
相关文章推荐
- UTF-8编码时,PHP如何正则匹配中文汉字?亲测可用
- php中utf-8编码下用正则表达式如何匹配汉字
- 回复:String中如果有中文,如何保证length()返回的长度 在 Java 中字符串是以 Unicode 方式编码的,所以,无论中英文都算的长度为 1。根据你的描述,估计是想要取得英文长度为 1 中文长度为 2 的总长度吧。这个,理论上可以构造 An
- php中utf-8编码下用正则表达式如何匹配汉字
- mysql 如何写语句替换某字段中 所有汉字,只剩下英文字母和符号。 编码是UTF-8
- php中utf-8编码下用正则表达式如何匹配汉字
- php中utf-8编码下用正则表达式如何匹配汉字
- php中utf-8编码下用正则表达式如何匹配汉字
- 中文乱码问题 ? 原因:JSP中默认使用iso-8859-1字符编码方式,不支持中文 ? 常见的支持中文的编码方式:gb2312(常用简体汉字)、gbk(简体和繁体汉字)、utf-8 ? 解决中文乱码
- 输入法项目->用delphi生成GBK 中文编码 表(4~5) GBK/4~5: 0xAA40~0xFEA0(部分) 扩充汉字 包括繁体 0xA840~0xA995(部分) 扩充非汉字
- source-insight中文:utf-8编码的中文字符在source in sight如何正常显示
- 中文编码为英文方式:
- 将ubuntu 8.04 (server x86_64)的系统编码由英文改成中文,即由en_US.UTF-8改为zh_CN.GBK
- 用delphi生成GBK 中文编码 表(4~5) GBK/4~5: 0xAA40~0xFEA0(部分) 扩充汉字 包括繁体 0xA
- php中utf-8、gbk编码下用正则表达式如何匹配汉字[转]
- JSP 表单输入,UTF编码,get方式提交数据出现中文乱码解决方法
- 通过“中文”两个字来深度剖析各种不同的编码方式,彻底理解乱码是如何产生的?
- source-insight中文:utf-8编码的中文字符在source in sight如何正常显示
- php中utf-8编码下用正则表达式匹配汉字的最终正确表达式——/^[x{4e00}-x{9fa5}]+$/u
- UTF-8, Unicode, GB2312三种编码方式解析, 深入研究汉字编码