re = /\-\s\*data\sintegrity\:\*/i
str = '- *Financial:* <yes or no. If yes, explain why>
- *Legal/Regulatory:* <yes or no. If yes, explain why>
- *Data Integrity:* <yes or no. If yes, explain why>
- *Patient Safety:* <yes or no. If yes, explain why>
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why>
- *Financial:* <yes/no>
- *Legal/Regulatory:* <yes/no>
- *Data Integrity:* <yes/no>
- *Patient Safety:* <yes/no>
- *CyberSecurity/Information Security:* <yes/no>
- *Financial:* <yes or no. If yes, explain why>No
- *Legal/Regulatory:* <yes or no. If yes, explain why> Yes
- *Data Integrity:* No
- *Patient Safety:* Yes, this was an issue because of XYZ.
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why>
- *Financial:* no
- *Legal/Regulatory:* no
- *Data Integrity:* no
- *Patient Safety:* no
- *CyberSecurity/Information Security:* no
- *Financial:* N
- *Legal/Regulatory:* N
- *Data Integrity:* N
- *Patient Safety:* N
- *CyberSecurity/Information Security:* N
- *Financial:* <yes or no. If yes, explain why>N
- *Legal/Regulatory:* <yes or no. If yes, explain why> N
- *Data Integrity:* <yes or no. If yes, explain why>N
- *Patient Safety:* <yes or no. If yes, explain why>N
- *CyberSecurity/Information Security:* <yes or no. If yes, explain why> N
'
# 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