Pattern recognition in genetic sequences by mismatch density