当前位置:网站首页>字符串提取 中文、英文、数字
字符串提取 中文、英文、数字
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
边栏推荐
- It turns out that Maya Arnold can also render high-quality works!Awesome Tips
- re正则表达式
- 2022起重机司机(限桥式起重机)考试题库及模拟考试
- Shared memory + inotify mechanism to achieve multi-process low-latency data sharing
- C# FileSystemWatcher
- [Tool Configuration] Summary of Common Uses of VSCode
- LaTeX Notes
- 工作3年,回想刚入门和现在的今昔对比,笑谈一下自己的测试生涯
- RK3568 environment installation
- 原来使Maya Arnold也能渲染出高质量作品!超赞小技巧
猜你喜欢
随机推荐
对数据类型而言运算符无效。运算符为 add,类型为 text。
typescript64-映射类型
2022 crane driver (limited bridge crane) exam question bank and simulation test
环网冗余式CAN/光纤转换器 CAN总线转光纤转换器中继集线器hub光端机
Bluetooth gap protocol
配合屏幕录像专家,又小又清晰!
HR:这样的简历我只看了5秒就扔了,软件测试简历模板想要的进。
Flink Learning 10: Use idea to write WordCount and package and run
【win7】NtWaitForKeyedEvent
2022.8.2 模拟赛
binary search tree problem
Libpq 是否支持读写分离配置
protobuf根据有关联的.proto文件进行编译
开启防火墙iptable规则后,系统网络变慢
Redis 全套学习笔记.pdf,太全了
Discourse 清理存储空间的方法
【JVM调优】Xms和Xmx为什么要保持一致
MySQL: basic part
MySQL: join query | inner join, outer join
IO进程线程->进程间的通信->day7








