Since you want to match any character from the entered word, you'll need to construct your regex to do just that:
const word = document.getElementById("searchedWord").value;
const allCharacters = word.split("");
const characterSet = new Set(allCharacters);
const uniqueCharacters = [...characterSet];
const pattern = `(${uniqueCharacters.join("|")})`;
const r = new Regex(pattern, "ig");