Created
September 15, 2014 06:35
-
-
Save songjiayang/2932ac9dbc89a806696b to your computer and use it in GitHub Desktop.
Javascript中如何忽略大小写正则匹配动态字符串。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key_word = "foo" | |
re = new RegExp(key_word, "i") | |
"Foo".match(re) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
well,believe or not
console.log('style1style2Style3style4'.match(/style/gi));
is working..............
as well as
/style/ig