I'm looking for some help from a regex guru, here's what I want to be able to match and remove using ruby/rails:
-----Original Message-----
From: STATIC on behalf of STATIC
Sent: Thu 11/25/2010 11:17 AM
To: Random, Random
Subject: Ra开发者_StackOverflow社区ndom replied to the comment
is it possible with regex to match these 5 lines with one Regex? Here's what I've been trying, without luck:
gsub(/-----Original Message-----/n.* From.*/n Sent.*/n To.*/n Subject.*/, '')
Thanks for the help
You need to reverse the slashes for the newlines and remove the extra space after each newline.
-----Original Message-----\n.*From.*\nSent.*\nTo.*\nSubject.*
http://rubular.com/r/z9NwUT7FWJ
精彩评论