尝试使用正则表达式来替换字符串中重复的任意两个字符集。我希望用重复子字符串的一次出现和重复的次数来替换这样的模式。例如,在下面的字符串中,我希望: qwertyabababababababababababa 变成: qwertyab11a 类似地, a a a a a a a a a a 应该变成: a 9a 我试过运行类似下面这样的代码: console.log("hello, this
我正在编写一个脚本来删除两个字符串中最长的重复子字符串。有两个字符串:a和b a = "Hello World: This is a test message"
b = "Good Bye: This is a test message" 由于存在重复项::This is a test message,因此将它们从两个字符串中删除。Good Bye: This is" 我正在考虑将<e