How to do this kind of fuzzy logic

Array = ["About Us-Website Announcement-Announcement Inner Page. html",
 "About Us-Website Announcement-Announcement Inner Page. html",
 "About Us-Website Announcement-News Inside Page. html",
 "about us. html",
 "Contact us. html",
 "our product. html"]

Enter the keyword “About Announcement” and search in array to display the following list.
Hope to provide a train of thought ~ ~


All search keywords are split, spliced with. * and then matched regularly. Javascript implementation method:

VaR Testray = NewArray ('About Us-Website Announcement-Announcement Inner Page. html',
 About Us-Website Announcement-News Inside Page. html',
 About us. html',
 Contact us. html',
 Our product. html';
 Var searchstr =' about announcements';
 var searcharr = searchstr.split('');
 var reg = new RegExp(searcharr.join('.*'));
 var resultarr=new Array();
 for(var i=0;  i<testarray.length;  I plus)
 if (reg.exec(testarray[i])) {

The final result is: [“About Us-Website Announcement-Inside Page of Announcement. html”, “About Us-Website Announcement-Inside Page of News. html”]