Search This Blog

Javascript: find all matches

const regex = /([^\/]+):/g;
const s = 'MMM:mmm/AAA:aaa/BBB:bbb/ccc';

let m;
while(m = regex.exec(s)) {
	console.log(m[0], m[1]);
}



see also

No comments:

Post a Comment