Regular Expressions

Pattern

Input

Bi r i k i üç d ör t b e ş a l t ı


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