当前位置:网站首页>js正则匹配数字、大小写字母、下划线、中线和点[通俗易懂]
js正则匹配数字、大小写字母、下划线、中线和点[通俗易懂]
2022-06-24 22:46:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
正则为:/[^a-z|A-Z|0-9|\-|_|\.]/g
<script>
var name = "hjhj测试[[[[[{
{
{
{as9-._>@##$$?W??";
var regs = /[^a-z|A-Z|0-9|\-|_|\.]/g;
name= name.replace(regs, "");
console.log("name:",name);
</script>输出结果是: hjhjas9-._W
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/151757.html原文链接:https://javaforall.cn
边栏推荐
- MPLS notes Part 1
- 内网学习笔记(5)
- What are the reasons for the abnormal playback of the online channel of the channel accessed by easycvr national standard protocol?
- How do the TMUX color palette work?
- Smartctl opens the device and encounters permission denied problem troubleshooting process record
- 当人们用互联网式的思维和视角来看待产业互联网的时候,其实已陷入到了死胡同
- Software testing salary in first tier cities - are you dragging your feet
- Cusdis - 轻量级、隐私优先的开源评论系统 | 倾城之链
- 【STL源码剖析】STL六大组件功能与运用(目录)
- 都2022年了,你还不了解什么是性能测试?
猜你喜欢

Software testing salary in first tier cities - are you dragging your feet

一线城市软件测试工资——你拖后腿了吗

【Proteus仿真】Arduino UNO+数码管显示4x4键盘矩阵按键

DDD concept is complex and difficult to understand. How to design code implementation model in practice?

常用的软件测试工具清单,请查收。

Can automate - 10k, can automate - 20K, do you understand automated testing?

Use of hashcat

业务与技术双向结合构建银行数据安全管理体系

JS array object to object

jwt
随机推荐
谈谈飞书对开发工作的优势 | 社区征文
Android物联网应用程序开发(智慧园区)—— 设置传感器阈值对话框界面
泰山OFFICE技术讲座:竖排时中文标点的简单研究
左手梦想 右手责任 广汽本田不光关注销量 还有儿童安全
Build and train your own dataset for pig face recognition
Full arrangement ii[duplicate removal of the same elements + standard backtracking]
Day 04 - file IO
【第26天】给定 n 个元素的升序数组nums,求实现一个函数在nums中寻找target的下标 | 初识二分查找
Basic layout -qhboxlayout class, qvboxlayout class, qgridlayout class
3年测试经验,连简历上真正需要什么都没搞明白,张口就要20k?
Computing service network: a systematic revolution of multi integration
Beescms website penetration test and repair comments "suggestions collection"
write a number of lines to a new file in vim
2022年云计算应用关键威胁调查
MPLS notes Part 1
MOS管相关知识
Investigation on key threats of cloud computing applications in 2022
保险APP适老化服务评测分析2022第06期
字符串数组转换为list集合
折叠屏将成国产手机分食苹果市场的重要武器