Ruby Regex在一段时间后添加一个空格

时间:2017-05-19 19:37:47

标签: ruby-on-rails ruby regex

我使用正则表达式在句点之后添加空格。我有以下正则表达式搜索没有空格的句号。

"This is new test.This is new test".gsub(/[.]+[^ ]+/, ". ")

但它正在取代"。这个"有时间和空间。我希望输出

"This is new test. This is new test"(note there is a space after period)

0 个答案:

没有答案