当前位置:网站首页>字符串提取 中文、英文、数字
字符串提取 中文、英文、数字
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
边栏推荐
猜你喜欢

二叉搜索树问题

2022 crane driver (limited bridge crane) exam question bank and simulation test

软件测试必问面试题(附答案和解析)

(4) Rotating object detection data roLabelImg to DOTA format

TRACE32——Go.direct

TCP的粘包拆包问题+解决方案

DNSlog外带数据注入

Shared memory + inotify mechanism to achieve multi-process low-latency data sharing

TRACE32——通用寄存器查看与修改

Modeling of the MAYA ship
随机推荐
2022.8.2 模拟赛
Summary of Text Characterization Methods
typescript60-泛型工具类型(readonly)
真实字节跳动测试开发面试题,拿下年薪50万offer。
Day9 of Hegong Daqiong team vision team training - camera calibration
binary search tree problem
【 LeetCode 】 235. A binary search tree in recent common ancestor
Shared memory + inotify mechanism to achieve multi-process low-latency data sharing
C# FileSystemWatcher
Using printf function in STM32
【Dynamic type detection Objective-C】
2022熔化焊接与热切割操作证考试题及模拟考试
RNote108---显示R程序的运行进度
Shiny04---Application of DT and progress bar in shiny
七夕?编程?
本地能ping通虚拟机,虚拟机ping不通本地
自媒体人一般会从哪里找素材呢?
TCP sticky packet unpacking problem + solution
Invalid operator for data type.The operator is add and the type is text.
一天学会从抓包到接口测试,通过智慧物业项目深度解析