Coggle requires JavaScript to display documents.
let text ="hello wello nillo fehgeig" let reg = /[hwn]ello/gi text.match(reg) // ["hello","wello"]
let reg =/[a-z]/gi
let reg = /[a-e0-5]/gi
/[^aeiou]/gi
let str ="Just a monent" let str2 = "A monent just" let reg = /^just/i reg.test(str) //true reg.test(str2) //false str.match(reg) // ["Just"] str2.match(reg) //null
let reg = /a+/gi
var str = "hello world" var myRegex =/world/ myRegex.test(str) //.test 方法,存在返回true,不存在返回false
let ourStr = "freecodecamp" let regex = /code/i regex.match(ourStr) //return [ 'code', index: 4, input: 'freecodecamp', groups: undefined ]