当前位置:网站首页>字符串提取 中文、英文、数字
字符串提取 中文、英文、数字
2022-08-05 07:03:00 【半生过往】
有时候需要判断拿到的字符串包含 中文、英文、数字,
- 提取中文
str.replace(/[^\u4E00-\u9FA5]/g,’’)
- 提取英文
str.replace(/[^a-zA-Z]/g,’’)
- 提取数字
str.replace(/[^\d]/g,’’)
判断是否包含某些字段
str.indexOf("字符") != -1 ? true : false
边栏推荐
- TRACE32——C源码关联1
- typescript59-泛型工具类型(partial )
- Hong Kong International Jewellery Show and Hong Kong International Diamond, Gem and Pearl Show kick off
- 在anaconda Promat界面import torch通过,在jupyter notebook中报错的问题(仅提供思路理解!)
- MySQL:order by排序查询,group by分组查询
- UDP group (multi)cast
- FPGA parsing B code----serial 4
- 2022.7.29好题选讲(计数专题)
- (4) Rotating object detection data roLabelImg to DOTA format
- Technical Analysis Patterns (11) How to Trade Head and Shoulders Patterns
猜你喜欢

400 times performance improvement 丨 swap valuation optimization case calculation

cmake 学习使用笔记(三)

typescript62-泛型工具类型(record)

Flink Learning 12: DataStreaming API

Bluetooth gap protocol

线程池的使用(结合Future/Callable使用)

RNote108---Display the running progress of the R program

算法拾遗十五补链表相关面试题

【 LeetCode 】 235. A binary search tree in recent common ancestor

今天虚竹哥又发现了一款好用的国产化API工具
随机推荐
In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
FPGA parsing B code----serial 4
MySQL:连接查询 | 内连接,外连接
Advanced Redis
Modeling of the MAYA ship
高端无主灯设计灯光设计该如何布置射灯灯具?
标准C语言15
不能比较或排序 text、ntext 和 image 数据类型
真实字节跳动测试开发面试题,拿下年薪50万offer。
Redis 全套学习笔记.pdf,太全了
2006年星座运势全解-巨蟹
re正则表达式
TRACE32——外设寄存器查看与修改
Illegal key size 报错问题
【 LeetCode 】 235. A binary search tree in recent common ancestor
protobuf is compiled against the associated .proto file
Technical Analysis Mode (8) Double Top and Bottom
17-VMware Horizon 2203 virtual desktop-Win10 manual desktop pool floating (seventeen)
Redis
Day9 of Hegong Daqiong team vision team training - camera calibration