Fixed NFD boundary issue in matches/replace