use String::Approx 'amatch'; @matches = amatch("saturday", ['4S0I0'], "is today saturd or sunday?", "atur"); @matches = amatch("abc4567def", ['6S0I0'], "1234567890", "---4567-----", "4567");