Skip to content

Instantly share code, notes, and snippets.

@shenqihui
Created January 13, 2015 09:06
Show Gist options
  • Save shenqihui/149701eb02fc19d15850 to your computer and use it in GitHub Desktop.
Save shenqihui/149701eb02fc19d15850 to your computer and use it in GitHub Desktop.
var regex = /gov.cn/ig;
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn");
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn");
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn");
console.log('regex.test("gov.cn")', regex.test("gov.cn"), "gov.cn");
@shenqihui
Copy link
Author

run 一下,结果:

regex.test("gov.cn") true gov.cn
regex.test("gov.cn") false gov.cn
regex.test("gov.cn") true gov.cn
regex.test("gov.cn") false gov.cn

为啥输出是这样子的 =_=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment