3
我想用正則表達式(javascript)在文本中移動句點。 的文字是這樣的:用RegEx替換string.replace()替換錯誤的字符
This is a text with ending period on wrong line
.
This is a another line
我用這個表達式:
summary.replace(/[\n\r]\.[\s\n\r]/gm, '.\r')
,使它看起來像這樣:
This is a text with ending period on wrong line.
This is a another line
但是,相反它看起來像這樣:
This is a text with ending period on wrong line
.his is a another line
不知道我的正則表達式中有什麼問題。
有人嗎?
怎麼樣/ [\ n替換\ R] + \。[\ S \ n \ R] /克 – Christophe