I'm using this code to list email addresses from a HTML page.

```
require 'nokogiri'

selector = "//a[starts-with(@href, \"mailto:\")]/@href"

doc = Nokogiri::HTML.parse File.read 'in.rb'

nodes = doc.xpath selector

addresses = nodes.collect {|n| n.value[7..-1]}

puts addresses

```

This is sample code I'm parsing:

```
<a href="mailto:joe@example.com?subject=My Business Is Dying">

```

But I'm getting more than just the email address. I'm getting this in my results:

```
joe@example.com?subject=My Business Is Dying

```

How do I drop off everything after the question mark so it's only the email address?