当前位置: 首页 > news >正文

找人给公司做网站去哪找海南建设教育执业网站

找人给公司做网站去哪找,海南建设教育执业网站,wordpress模块里加载最新文章,企业网站建设的作用标准的正则表达式是什么样的 Node.js(JavaScript) 在正则表达式中#xff0c;斜杠#xff08;/#xff09;用来表示正则表达式的开始和结束。在JavaScript中#xff0c;正则表达式可以使用斜杠包裹起来#xff0c;以表示这是一个正则表达式的字面量。 在Node.js中…标准的正则表达式是什么样的 Node.js(JavaScript) 在正则表达式中斜杠/用来表示正则表达式的开始和结束。在JavaScript中正则表达式可以使用斜杠包裹起来以表示这是一个正则表达式的字面量。 在Node.js中可以使用正则表达式的test()方法来检查一个字符串是否匹配某个模式。以下是一个示例代码演示了如何使用正则表达式匹配以1开头后面跟着两个数字的字符串 const str 123; const regex /^1\d{2}$/;if (regex.test(str)) {console.log(匹配成功); } else {console.log(匹配失败); }在上面的示例中^1\d{2}$是一个正则表达式它的含义是 ^匹配字符串的开头 1匹配字符1 \d{2}匹配两个数字\d表示任意数字{2}表示匹配两次 $匹配字符串的结尾 因此该正则表达式可以匹配以1开头后面跟着两个数字的字符串。在示例中str的值为123它符合这个模式所以输出结果为匹配成功。 Java private void RegTest2() {String content abc$(abc(1.23(;//匹配(String regStr \\d{2}; // String regStr \\.;Pattern pattern Pattern.compile(regStr);Matcher matcher pattern.matcher(content);while (matcher.find()){Log.i(TAG,match: matcher.group(0));}}2023-08-11 17:49:18.021 27898-29062/cn.jj.reg I/JJWorld.MainActivity: match:23结论 不同语言正则表达式有区别缺乏统一的正则标准。 ASCII码表 java读取文件assets中ini文件时转义符修改的问题 java读取文件时分为了三步。 第一步通过inputStream获取输入流。 如果将读取到的数据依次打印的话可以看到是读取到了转移字符的 Properties properties IniPropertiesReadUtils.loadFileFromAssetsNew(this, jjapm1.ini);//读取Assets目录下的配置文件public static Properties loadFileFromAssetsNew(Context context, String filePath) {if (null context || null filePath || filePath.length() 0)return null;InputStream assetFileIS null;InputStreamReader assetFileISReader null;Properties properties new Properties();int readData 0;try {assetFileIS context.getResources().getAssets().open(filePath);while ((readData assetFileIS.read())! -1){Log.i(TAG,read: (char)readData);}} catch (IOException e) {e.printStackTrace();properties null;} finally {try {if (null ! assetFileIS) {assetFileIS.close();}if (null ! assetFileISReader) {assetFileISReader.close();}} catch (IOException e) {e.printStackTrace();}}return properties;}2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:c 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:l 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:a 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:s 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:s 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:R 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:u 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:l 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:e 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read: 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read: 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read: 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:ä 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:¸ 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:­ 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:{ 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:\ 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:d 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:\ 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:d 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read: 2023-08-12 10:05:26.258 27428-27460/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read:} 上面打印的控制信息不管可见是打印出来了classRule 中{\d\d}的只不过中文是乱码。 第二步 通过InputStreamReader获取输入字符流处理乱码问题 //读取Assets目录下的配置文件public static Properties loadFileFromAssetsNew(Context context, String filePath) {if (null context || null filePath || filePath.length() 0)return null;InputStream assetFileIS null;InputStreamReader assetFileISReader null;Properties properties new Properties();int readData 0;try {assetFileIS context.getResources().getAssets().open(filePath); // while ((readData assetFileIS.read())! -1){ // Log.i(TAG,read: (char)readData); // }assetFileISReader new InputStreamReader(assetFileIS, UTF-8);while ((readData assetFileISReader.read())! -1){Log.i(TAG,read11: (char)readData);}} catch (IOException e) {e.printStackTrace();properties null;} finally {try {if (null ! assetFileIS) {assetFileIS.close();}if (null ! assetFileISReader) {assetFileISReader.close();}} catch (IOException e) {e.printStackTrace();}}return properties;}2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:c 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:l 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:a 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:s 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:s 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:R 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:u 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:l 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:e 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11: 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11: 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11: 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:中 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:{ 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:\ 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:d 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:\ 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:d 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11: 2023-08-12 10:06:52.827 27565-27600/cn.jj.reg I/JJWorld.IniPropertiesReadUtils: read11:}转义符依然是存在的classRule 中{\d\d} 第三步 properties.load(assetFileISReader)对转义符进行了特殊处理导致转义符失效 JSONObject对转义符的处理 private void jsonRegTest() throws JSONException {String jsonStr {key:\va\\lue\};// JSONObject对\的处理JSONObject jsonObject new JSONObject(jsonStr);Log.i(TAG, jsonRegTest: jsonObject.toString());} public JSONObject(NonNull String json) throws JSONException {this(new JSONTokener(json));}new JSONObject会创建一个JSONTokener。JSONTokener保留设置进来的字符串。 public JSONTokener(String in) {// consume an optional byte order mark (BOM) if it existsif (in ! null in.startsWith(\ufeff)) {in in.substring(1);}this.in in;}JSONObject(String)核心代码 public JSONObject(NonNull JSONTokener readFrom) throws JSONException {/** Getting the parser to populate this could get tricky. Instead, just* parse to temporary JSONObject and then steal the data from that.*/Object object readFrom.nextValue();if (object instanceof JSONObject) {this.nameValuePairs ((JSONObject) object).nameValuePairs;} else {throw JSON.typeMismatch(object, JSONObject);}}
http://www.zqtcl.cn/news/440815/

相关文章:

  • 深圳全国网站制作哪个好页面设计有哪几种风格
  • 网页设计作业网站素材和效果图夏天做啥网站致富
  • 利用帝国软件如何做网站网站友链交换平台
  • 简述网站开发技术深圳网站设计合理刻
  • wordpress网站名称寻找销售团队外包
  • 一浪网站建设网页qq邮箱
  • 做网站需要注册公司吗夫唯seo系统培训
  • 沈阳人流哪个医院好安全百度关键词优化怎么做
  • 1688网站怎么做分销高质量的网站内容建设
  • 网站建设公司济宁网站转跳怎么做
  • 镇江网站设计多少钱企业网络部署方案
  • 建网站的公司浩森宇特wordpress登录缓存
  • 便宜建站空间战队头像在线制作免费
  • 做招聘网站赚钱吗厦门网站建设哪里好
  • 新乡网站建设哪家公司好阿里巴巴做国际网站多少钱
  • 怎么在悉尼做网站dede做手机网站
  • 企业网站模板免费下载品牌建设专家库推荐表
  • 辽宁智能网站建设推荐网络营销推广方案创意
  • 安阳做一个网站多少钱东营做网站公司
  • 深圳市罗湖网站建设百度自助建站官网
  • 网站开发安装环境网站建设销售话术
  • 网站权重网站栏目划分的原则
  • 国际网站建设的目的我的百度账号登录
  • 温州网站设计定制博客和网站的区别
  • 益阳建设网站wordpress加载图片慢
  • 网站官网阜新网站开发公司
  • 适合做网站的图片印刷公司网站模板
  • 南昌哪家网站建设最好网站建设的方法有
  • 东莞做网站 动点官网百度开户流程
  • 中力建设网站怎么做自己的门户网站