Created
May 21, 2018 12:47
-
-
Save zhangkn/c45a676bfdec250d8e85c2f038625931 to your computer and use it in GitHub Desktop.
This file contains 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
//生成 regexp 对象需要使用 getRegExp函数。 | |
getRegExp(pattern[, flags]) | |
//参数: | |
//pattern: 正则表达式的内容。 | |
//flags:修饰符。该字段只能包含以下字符: g: global ; i: ignoreCase ; m: multiline。 | |
// 示例代码: | |
var a = getRegExp("x", "img"); | |
console.log("x" === a.source); | |
console.log(true === a.global); | |
console.log(true === a.ignoreCase); | |
console.log(true === a.multiline); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment