在 PHP 中,我想使用正则表达式通过以下公式修改具有重复字符的字符串:
1. Chars different from "r", "l", "e" repeated more than once
consecutively should be replaced for the same char only one time.
Example:
- hungryyyyyyyyyy -> hungry.
- hungryy -> hungry
- speech -> speech
2. Chars "r", "l", "e" repeated more than twice replaced for the same
char twice.
Example:
- greeeeeeat -> greeat
在此先感谢
巴勃罗