I have a list of about 120 thousand english words (basically every word in the language).
I need a regular expression that would allow searching through these words
function matchWild(wild,name) { if (wild == '*') return true; wild = wild.replace(/\./g,'\\.'); wild = wild.replace(/\?/g,'.'); wild = wild.replace(/\\/g,'\\\\'); wild = wild.replace(/\//g,'\\/'); wild = wild.replace(/\*/g,'(.+?)'); var re = new RegExp(wild,'i'); return re.test(name); }