Answers for "exec js"

0

exec reges

const regex = /([a-z]*)ball/g;
const str = "basketball football baseball";
let result;
while((result = regex.exec(str)) !== null) {
	console.log(result[1]); 
    // => basket
    // => foot
    // => base
}
Posted by: Guest on October-11-2020
0

exec js

var str = "The best things in life are free";
var patt = new RegExp("e");

 var res = patt.exec(str);
Posted by: Guest on July-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language