[英]Is there any way to find unmatched character using JavaScript?
recently I found that we can find all vowels character using regex function like this最近我发现我们可以像这样使用正则表达式 function 找到所有元音字符
const vowel = str.match(/[aiueo]/gi);
But is there any way to find all non vowels character using this match function?但是有没有办法使用这个匹配 function 找到所有非元音字符?
So when I have word "thanks"所以当我有“谢谢”这个词时
It will count all non vowel character length, so the result will be 5它将计算所有非元音字符的长度,因此结果将为 5
Maybe anyone would share this information, I was trying to find in google, but still not found any good solution也许有人会分享这些信息,我试图在谷歌中找到,但仍然没有找到任何好的解决方案
Thanks谢谢
Putting the ^
character in front of a character set negates the set将
^
字符放在字符集前面会否定该集
const notVowel = str.match(/[^aiueo]/gi);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.