Created
October 31, 2010 11:25
-
-
Save madrobby/656467 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body = "some email\r\nblah\nblah wrote on X:\n>blech\n\n\i write, you wrote\n>blah\n\n\n>last line" | |
filtered = body.gsub(/\r/,'').gsub(/^(.*\n){0,1}.*:\n(?=>)/,'').gsub(/^>.{0,}$/,'').gsub(/\n\n+/,"\n\n").strip | |
// => "some email\ni write, you wrote" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment