mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 11:36:23 +00:00
473 B
473 B
date | id | title |
---|---|---|
2020-11-04 | eff92c39-8459-4f55-a34b-d924eb603056 | JavaScript RegExp Test Method |
test1 returns true/false:
let re1 = new RegExp("abc");
let re2 = /abc/;
console.log(re1.test("abc")) // true
console.log(re1.test("acd")) // false
console.log(/abc/.test("abcde")) // true
console.log(/abc/.test("abxde")) // false