re = /(?i)^(Where|How|Is|Does|I wanna|I want|I wish)\b.*\bdemo( game| version( of the game)?)?( exist| available| out there)?(\.|\?|!)*?$/m
str = 'How can I download the demo
Where get demo?!?!
where is the demo version of the game?
How do I get the demo game!
Anyone know how to get the demo?
How does one download a geneshit
so I was wondering, how do we get more newbies to play the demo
Does a demo version of the game exist?!?!?
Is a demo version of the game available
is a demo version of the game out there
Is there a demo version?
I wish there was a demo version
is a demo out there?'
# 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