title: XPath with regex match on an attribute value
body: <p>All -</p>
  
  <p>I've searched and tinkered around for hours in an effort to crack this one, but I'm still having problems. I have the XML data below:</p>
  
  <pre><code>&lt;game id="2009/05/02/arimlb-milmlb-1" pk="244539"&gt;
    &lt;team id="109" name="Arizona" home_team="false"&gt;
      &lt;event number="9" inning="1" description="Felipe Lopez doubles to left fielder Chris Duffy.  "/&gt;
      &lt;event number="15" inning="1" description="Augie Ojeda flies out to center fielder Mike Cameron.  "/&gt;
      &lt;event number="23" inning="1" description="Chad Tracy doubles to right fielder Joe Sanchez.  "/&gt;
      &lt;event number="52" inning="2" description="Mark Reynolds lines out to left fielder Chris Duffy.  "/&gt;
      &lt;!-- more data here --&gt;
    &lt;/team&gt;
  &lt;/game&gt;
  </code></pre>
  
  <p>I'm trying to get the total number of event nodes that contain the text ' doubles ' in the value of the description attribute. This is what I've been trying so far, to no avail (irb throws an error):</p>
  
  <pre><code>"/game/team/event/@description[matches(.,' doubles ')]"
  </code></pre>
  
  <p>Since I'm just trying to match a fragment of the value of the description attribute, it's possible to use the XPath 2.0 function 'matches', right? If so, what am I doing wrong?</p>
  
  <p>Thanks in advance for any help!</p>