subject = (/^Subject\: (.+)$/).match(email)[1]
Prior to this code I would have used the following:
email[/^Subject\: (.+)$/] subject = $1
Reference: Ruby SMTP Server - Save to Database [dzone.com]
11303 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
subject = (/^Subject\: (.+)$/).match(email)[1]
email[/^Subject\: (.+)$/] subject = $1
You need to create an account or log in to post comments to this site.
Essentially the same as your second snippet but in one line and without the global, which I assume were your problems with it?