re = /(?<!\s{1}Jr[.!?]|\s{1}Mr[.!?]|\s{1}Mrs[.!?]|\s{1}Ms[.!?]|\s{1}Dr[.!?]|\s{1}Prof[.!?]|\s{1}Sr[.!?]|\s{1}vs[.!?]|\s{1}etc[.!?]|\s{1}no[.!?])(?<=[.?!])\s+(?=[a-z])/i
str = ''
# Print the match result
str.match(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html