JSFiddle - React, Tailwind, and code Playground
JavaScript
const text = ["text 123 ->My Mom's house<- jidjio",
"bla bla ->My8Mo2ms231#43house<- bla bla",
"Test string ->My Mom's' house<- further text",
"wkashhasMdykMomLsfheoousssswQseBswenksd",
"textMy?M?om*s?*hou?*seorsomethingelse",
"thisIs3MôyMäoméshouseEFSAcasw!"];
const search_string = "MyMomshouse";
const regex_string = Array.from(search_string).join('.*?')
console.log(regex_string)
text.forEach((entry) => {
console.log(entry.search(regex_string));
});