当前位置:网站首页>字符串提取 中文、英文、数字
字符串提取 中文、英文、数字
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
边栏推荐
- MySQL: order by sorting query, group by grouping query
- binary search tree problem
- 【 LeetCode 】 235. A binary search tree in recent common ancestor
- Redis数据库学习
- AI + video technology helps to ensure campus security, how to build a campus intelligent security platform?
- 软件测试必问面试题(附答案和解析)
- Redis
- Shiny02---Shiny exception solution
- In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
- 性能提升400倍丨外汇掉期估值计算优化案例
猜你喜欢
随机推荐
Summary of Text Characterization Methods
对数据类型而言运算符无效。运算符为 add,类型为 text。
Mysql为什么 建立数据库失败
IO进程线程->进程间的通信->day7
女生做软件测试会不会成为一个趋势?
C# FileSystemWatcher
1, Citrix XenDesktop 2203 AD domain system installation (1)
MySQL: basic part
游戏思考19:游戏多维计算相关:点乘、叉乘、点线面距离计算
FPGA parsing B code----serial 4
In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
typescript64-映射类型
Takeda Fiscal 2022 First Quarter Results Strong; On Track to Achieve Full-Year Management Guidance
TRACE32——SMP多核调试
线程池的使用(结合Future/Callable使用)
自媒体人一般会从哪里找素材呢?
cmake 学习使用笔记(三)
C-Eighty seven(背包+bitset)
【 LeetCode 】 235. A binary search tree in recent common ancestor
【win7】NtWaitForKeyedEvent









