[Regex Expression] Find Sets of Characters
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Regex Expression] Find Sets of Characters相关的知识,希望对你有一定的参考价值。
Regular Expression Character Classes define a group of characters we can use in conjunction with quantifiers.
var str = `cat bat mat Hat 0at ?at`; var regex = /[bc]at/g; // match ‘cat bat‘ // the same as: var regex = /(b|c)at/g; var regex = /[^bc]at/g; // matcg ‘mat Hat 0at ?at‘ var regex = /[a-zA-Z0-9?]at/g; // match all the string,
以上是关于[Regex Expression] Find Sets of Characters的主要内容,如果未能解决你的问题,请参考以下文章