我在 Javascript 中有这个字符串:
text = "2222 22:22: John: New York /n last year and: the next year /n 3333 33:33: Jack: Los Angeles!!!"
我希望它是以下内容:
newText = "(xSep)2222 22:22:(zSep) John:(zSep) New York /n last year and: the next year /n (xSep)3333 33:33:(zSep) Jack:(zSep) Los Angeles!!!"
我已经尝试了很多东西,只有这样我的其余代码才能工作。所以“(xSep)”应该出现在 每四个数字之前,“(zSep)”应该只出现在前 两个“:”之后
请帮我解决一下这个。提前谢谢你。