首页 > 其他分享 >提取最新的各国疫情数据中json字符串

提取最新的各国疫情数据中json字符串

时间:2023-05-05 21:11:11浏览次数:35  
标签:skuId commodityId 疫情 sellStatus zxcgvhbjk json https 字符串 cool

1.正则表达式提取json字符串:

 

 

 

-----------------------------------------------------------------初始数据-----------------------------------------------------------------
try { window.fetchIndexMallList = {"success":true,"errorCode":0,"results":{"items":[{"commodityId":"3591210463042011540","commodityLogo":"https://img1.dxycdn.com/2022/1230/768/5942165308020931953-68.png","commodityName":"现货抗原检测试剂盒25人份","cornerMark":"限量抢购中","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3588838986124169233&from=other&chdShareFromId=3589899615392486250&chdShareEntityId=3370441352948220030&chdShareType=2","miniProgramShortLink":"https://dxy.cool/YTGSHf","skuId":"3591210463042011547","price":25800,"discountPrice":6500,"sortId":110,"sellStatus":0},{"commodityId":"3549260783022588925","commodityLogo":"https://img1.dxycdn.com/2022/1205/807/2086858196898476853-68.png","commodityName":"维生素C凝胶糖果60粒","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3587310742271172996&from=other&chdShareFromId=3589406510197798564&chdShareEntityId=3370441352948220031&chdShareType=2","miniProgramShortLink":"https://dxy.cool/13pZ2L","skuId":"3551181722177885802","price":9900,"discountPrice":7900,"sortId":90,"sellStatus":0},{"commodityId":"3594172021233582418","commodityLogo":"https://img1.dxycdn.com/2023/0114/646/1929590820066714953-68.png","commodityName":"海水鼻腔喷雾器1支起","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3587310742271172996&from=other&chdShareFromId=3589406510197798564&chdShareEntityId=3370441352948220031&chdShareType=2","miniProgramShortLink":"https://dxy.cool/13pZ2L","skuId":"3594176537391615470","price":4900,"discountPrice":4500,"sortId":70,"sellStatus":0},{"commodityId":"3523848908935773531","commodityLogo":"https://img1.dxycdn.com/2022/0704/828/9538664325660228553-68.png","commodityName":"鼻子纸30抽*40包","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3587310742271172996&from=other&chdShareFromId=3589406510197798564&chdShareEntityId=3370441352948220031&chdShareType=2","miniProgramShortLink":"https://dxy.cool/13pZ2L","skuId":"3523848908935773539","price":11900,"discountPrice":11900,"sortId":60,"sellStatus":0},{"commodityId":"3590133205787542772","commodityLogo":"https://img1.dxycdn.com/2022/1219/969/6714530548409439853-68.jpg","commodityName":"安贝儿75%酒精消毒液120ml*2瓶","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3588838986124169233&from=other&chdShareFromId=3590079383396684707&chdShareEntityId=3370441352948220030&chdShareType=2","miniProgramShortLink":"https://dxy.cool/38Botr","skuId":"3590133205787542780","price":7980,"discountPrice":7980,"sortId":1,"sellStatus":0}]}}}catch(e){}

 


-------------------------------------------------------json_str:正则表达式提取json字符串---------------------------------------------------

[{"commodityId":"3591210463042011540","commodityLogo":"https://img1.dxycdn.com/2022/1230/768/5942165308020931953-68.png","commodityName":"现货抗原检测试剂盒25人份","cornerMark":"限量抢购中","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3588838986124169233&from=other&chdShareFromId=3589899615392486250&chdShareEntityId=3370441352948220030&chdShareType=2","miniProgramShortLink":"https://dxy.cool/YTGSHf","skuId":"3591210463042011547","price":25800,"discountPrice":6500,"sortId":110,"sellStatus":0},{"commodityId":"3549260783022588925","commodityLogo":"https://img1.dxycdn.com/2022/1205/807/2086858196898476853-68.png","commodityName":"维生素C凝胶糖果60粒","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3587310742271172996&from=other&chdShareFromId=3589406510197798564&chdShareEntityId=3370441352948220031&chdShareType=2","miniProgramShortLink":"https://dxy.cool/13pZ2L","skuId":"3551181722177885802","price":9900,"discountPrice":7900,"sortId":90,"sellStatus":0},{"commodityId":"3594172021233582418","commodityLogo":"https://img1.dxycdn.com/2023/0114/646/1929590820066714953-68.png","commodityName":"海水鼻腔喷雾器1支起","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3587310742271172996&from=other&chdShareFromId=3589406510197798564&chdShareEntityId=3370441352948220031&chdShareType=2","miniProgramShortLink":"https://dxy.cool/13pZ2L","skuId":"3594176537391615470","price":4900,"discountPrice":4500,"sortId":70,"sellStatus":0},{"commodityId":"3523848908935773531","commodityLogo":"https://img1.dxycdn.com/2022/0704/828/9538664325660228553-68.png","commodityName":"鼻子纸30抽*40包","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3587310742271172996&from=other&chdShareFromId=3589406510197798564&chdShareEntityId=3370441352948220031&chdShareType=2","miniProgramShortLink":"https://dxy.cool/13pZ2L","skuId":"3523848908935773539","price":11900,"discountPrice":11900,"sortId":60,"sellStatus":0},{"commodityId":"3590133205787542772","commodityLogo":"https://img1.dxycdn.com/2022/1219/969/6714530548409439853-68.jpg","commodityName":"安贝儿75%酒精消毒液120ml*2瓶","cornerMark":"","miniProgramLink":"/pages/common/cms/activity/index?name=jk_zxcgvhbjk&moduleId=3588838986124169233&from=other&chdShareFromId=3590079383396684707&chdShareEntityId=3370441352948220030&chdShareType=2","miniProgramShortLink":"https://dxy.cool/38Botr","skuId":"3590133205787542780","price":7980,"discountPrice":7980,"sortId":1,"sellStatus":0}]

 

2.正则表达式总结:

 

标签:skuId,commodityId,疫情,sellStatus,zxcgvhbjk,json,https,字符串,cool
From: https://www.cnblogs.com/vless/p/17375369.html

相关文章

  • 1 字符串 、2 指针 、3 结构体 、4 方法、 5 接口
    目录1字符串2指针3结构体4方法5接口1字符串packagemain//字符串funcmain(){ //1定义字符串 //vars="中alqz" //2字符串可以按下标取值,不能改 //s[0]=98 //fmt.Println(s[0])//取字节,是个数字 //fmt.Println(s[3]) //fmt.Printf("%T\n",s[3])/......
  • 【Java】对pdf表格中的字符串进行换行处理
    需求:将数据库查出来的字符串数组放入pdf的表格中,并且每个字符串单独占一行解决:1、尝试在字符串后面加上/r或/n无效:只会在两个字符串之间加上一个空格 2、尝试在字符串后面加上/br无效,无法识别/br,只会识别成/b与字符串r 3、尝试使用第三方库的方法(成功)三方库为:com.i......
  • 金仓数据库字符串分割函数
    1.SPLIT_PARTSPLIT_PART()函数通过指定分隔符分割字符串,并返回第N个子串。语法:SPLIT_PART(string,delimiter,position)11、string:待分割的字符串2、delimiter:指定分割字符串3、position:返回第几个字串,从1开始,该参数必须是正数。如果参数值大于分割后字符串的数量,函数返回......
  • IP地址字符串转数组
    查看代码staticuint8_tip_buf[4];staticuint8_ttest_str[]="192.168.1.123";staticuint8_tipstr2num(uint8_t*src_str);voidipstr2num(uint8_t*src_str){inti=0,j=0,k=0;charnew_str[3];while(*src_str!='\0'......
  • Json工具类
    publicclassJsonUtils{privatestaticSerializeConfigmapping=createConfig();publicJsonUtils(){}privatestaticSerializeConfigcreateConfig(){SerializeConfigconfig=newSerializeConfig();config.put(Date.class,newS......
  • 第四章 字符串
    串string,零个或多个字符组成的有限序列.空串用∅表示子串:串中任意个字符的序列.主串:包含子串的串ASCII编码串的存储字符串的模式匹配朴素模式匹配算法时间复杂度O((n-m+1)*m)=O(nm)KMP算法主串指针不回溯.......
  • JAVA中字符串的常用方法
    JAVA中字符串的常用方法字符串不能改变,创建后就无法更改了创建字符串的两种方式直接赋值new的方式获取一个字符串对象 构造方法构造方法说明publicString()创建空白字符串,不包含任何内容publicString(StringOriginal)根据传入的字符串,创建字符串对象......
  • 翻转字符串里的单词
    题目:给定一个字符串,逐个翻转字符串中的每个单词。示例1:输入:"theskyisblue"输出: "blueisskythe输入字符串可以在前面或者后面包含多余的空格,但是反转后的字符不能包括如果两个单词间有多余的空格,将反转后单词间的空格减少到只含一个。解题思路:移除多余空格(双指针......
  • TypeScript 学习笔记 — 模板字符串和类型体操(十五)
    目录基本介绍字符串类型体操实操环节1.字符串首字母大写CapitalizeString2.获取字符串第一个字符FirstChar3.获取字符串最后一个字符LastChar4.字符串转元组StringToTuple5.元组转字符串TupleToString6.重复字符串RepeatString7.字符串分割SplitString8.获取字符串......
  • ENOENT: no such file or directory, open 'D:\Idea lorkSpacecjccx-ui\package.js
     启动项目报找不到package.json找到你项目的package.json的路径 然后cd 这个路径 然后就解决了......