Answers for "regex match all occurrences javascript"

0

get all matches regex javascript

var re = /s*([^[:]+):"([^"]+)"/g;
var s = '[description:"aoeu" uuid:"123sth"]';
var m;

do {
    m = re.exec(s);
    if (m) {
        console.log(m[1], m[2]);
    }
} while (m);
Posted by: Guest on June-19-2021
0

javascript regex One or more occurrences of the pattern

// Regular expression 1 or more occurrences of the pattern
console.log(/'d+'/.test("'123'")); // true
console.log(/'d+'/.test("''")); // false

let cartoonCrying = /boo+(hoo+)+/i;
console.log(cartoonCrying.test("Boohoooohoohooo"));// true
Posted by: Guest on June-28-2020

Code answers related to "regex match all occurrences javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language