我有例如文本:如何更換一個逗號外支架
我就喜歡吃餡餅,我想帶着狗出去,我想去游泳(餡餅,狗,游泳)
我需要一個JavaScript正則表達式,與()
之外的新線取代了,
現在如果我使用.replace(/,/g, "\n")
我會得到:
I would like to eat a pie
I would like to take the dog out
I would like to swim(pie
dog
out)
我需要的是:
I would like to eat a pie
I would like to take the dog out
I would like to swim(pie,dog,swim)
大膽的假設。 –
你釘了它,非常好 – sForSujit
太棒了,它像一個魅力。謝謝你們的快速響應! –