我正在尝试使用正则表达式(javascript)来移动文本中的句点。文本如下所示:
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
无法弄清楚我的正则表达式有什么问题。
任何人?