String matching using edit distance algorithm