<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: backreference code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 11 Oct 2008 09:54:04 GMT</pubDate>
    <description>DZone Snippets: backreference code</description>
    <item>
      <title>Finding your match with Ruby</title>
      <link>http://snippets.dzone.com/posts/show/5157</link>
      <description>This example finds an email subject in a string and passes the value to a variable called 'subject'.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;subject = (/^Subject\: (.+)$/).match(email)[1]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Prior to this code I would have used the following:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  email[/^Subject\: (.+)$/]&lt;br /&gt;  subject = $1&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Reference: &lt;a href="http://snippets.dzone.com/posts/show/5152"&gt;Ruby SMTP Server - Save to Database&lt;/a&gt; [dzone.com]</description>
      <pubDate>Wed, 20 Feb 2008 09:20:51 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5157</guid>
      <author>jrobertson (James Robertson)</author>
    </item>
  </channel>
</rss>
