re = /\bm(?:iss|r?s?)\b (?:de |di |du |de la |van )?[a-z]+[-']?[a-z]*/
str = 'i have fixed mr jones fridge. mrs jones was happy with the service. miss johnson-taylor told ms o\'neil that everything was fabulous. mr van larsen was less than impressed but that was a missunderstanding.'
# Print the match result
str.scan(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