开发者

What does /i at the end of a regex mean?

开发者 https://www.devze.com 2023-02-09 18:26 出处:网络
What is the meaning of开发者_开发百科 /i at the tail of this regex? var time = /^([1-9]|1[0-9]):([0-5][0-9])(\\s[a|p]m)$/i;

What is the meaning of开发者_开发百科 /i at the tail of this regex?

var time = /^([1-9]|1[0-9]):([0-5][0-9])(\s[a|p]m)$/i;


/i stands for ignore case in the given string. Usually referred to as case-insensitive as pointed out in the comment.


It's, like Sachin Shanbhag already answered the 'ignore case' modifier. So /[a-z]/i is equal to /[a-zA-Z]/. Check this link for other modifiers.

0

精彩评论

暂无评论...
验证码 换一张
取 消