re = /(X-PPP-Vhost: test.com)/m
str = 'From: alex@test.comTo: alex2 alex2@test.comSubject: testing email filterUser-Agent: Roundcube Webmail/1.4.11 Message-ID: 3907e0dede914479d42ecddb829da9a6@test.comX-Sender: alex@test.comContent-Type: text/plain; charset=US-ASCII; format=flowedContent-Transfer-Encoding: 7bitX-PPP-Message-ID: 164243412854.574642.9867894171662743646@intelligent-mahavira.ip.plesk.pageX-PPP-Vhost: test.com'
# 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