首页 > 其他 > 详细

[Regex Expression] Find Sets of Characters

时间:2016-02-01 09:35:54      阅读:162      评论:0      收藏:0      [点我收藏+]

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

原文:http://www.cnblogs.com/Answer1215/p/5174333.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!