当前位置:网站首页>字符串提取 中文、英文、数字
字符串提取 中文、英文、数字
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
边栏推荐
- Cannot compare or sort text, ntext, and image data types
- typescript59-泛型工具类型(partial )
- 【动态类型检测 Objective-C】
- MySQL:连接查询 | 内连接,外连接
- Bluetooth gap protocol
- U++ UE4官方文档课后作业
- 基于快速行进平方法的水面无人船路径规划
- Week 8 Document Clustering(文本聚类)
- "Automatic Data Collection Based on R Language"--Chapter 3 XML and JSON
- C# FileSystemWatcher
猜你喜欢
Hash 这些知识你也应该知道
RNote108---显示R程序的运行进度
400 times performance improvement 丨 swap valuation optimization case calculation
cmake 学习使用笔记(三)
binary search tree problem
UDP broadcast
不太会讲爱,其实已经偷偷幸福很久啦----我们的故事
After working for 3 years, I recalled the comparison between the past and the present when I first started, and joked about my testing career
Task flow scheduling tool AirFlow,, 220804,,
2022熔化焊接与热切割操作证考试题及模拟考试
随机推荐
typescript60-泛型工具类型(readonly)
Mysql为什么 建立数据库失败
typescript59-泛型工具类型(partial )
Discourse 清理存储空间的方法
【 LeetCode 】 235. A binary search tree in recent common ancestor
In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
Database table insert data
1, Citrix XenDesktop 2203 AD domain system installation (1)
2006年星座运势全解-巨蟹
Mysql主从延迟的原因和解决方案
2022熔化焊接与热切割操作证考试题及模拟考试
The NDK compiler so libraries
mysql使用in函数的一个小问题
Week 8 Document Clustering(文本聚类)
TRACE32——Go.direct
After working for 3 years, I recalled the comparison between the past and the present when I first started, and joked about my testing career
自媒体人一般会从哪里找素材呢?
protobuf is compiled against the associated .proto file
typescript61-泛型工具类型(pick)
Redis 全套学习笔记.pdf,太全了