JSFiddle - React, Tailwind, and code Playground

by jfriend00

JavaScript

var txt = "Local residents o1__have called g__in o22__with reports...";
var re = /o([0-9]+)__/g;
while ((matches = re.exec(txt)) != null) {
    alert(matches[1]);
}