您的位置:首页 > 其它

[Regex Expression] Find Sets of Characters

2016-02-01 03:14 274 查看
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,
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: