Regular Expressions

Pattern

Input

Bugün 23/6/2018 saat 14


Sample code
function setValues() {
pat.value = ptrn[menu.selectedIndex];
inp.value = word[menu.selectedIndex];
checkRE();
}
function checkRE() {
if (pat.value && inp.value) {
const exp = new RegExp(pat.value,'g');
const str = "<span class=found>$&</span>";
out.innerHTML = inp.value.replace(exp, str);
}
}

Ref: Term project by Emrah Tema