当前位置:网站首页>JS regular matching numbers, upper and lower case letters, underscores, midlines and dots [easy to understand]

JS regular matching numbers, upper and lower case letters, underscores, midlines and dots [easy to understand]

2022-06-25 02:28:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm your friend, Quan Jun .

Regular is :/[^a-z|A-Z|0-9|\-|_|\.]/g

<script>
   var name = "hjhj test [[[[[{
  
  {
  
  {
  
  {as9-._>@##$$?W??";
   var regs = /[^a-z|A-Z|0-9|\-|_|\.]/g;
   name= name.replace(regs, "");
   console.log("name:",name);
 </script>

The output is : hjhjas9-._W

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151757.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206242246017982.html