The expression /\d5/g
, matches with "15" in "155", but not "55".
How do I modify the expression so it matches with "15" and "55" in "155"?
Apparently, I have to do something called a "lookahead assertion".
let str = '155';
let regEx = /(?=(\d5))/g;
let matches = str.matchAll(regEx);