I just referred to this practice and found that the result might be wrong if the string pattern is "TTE"