title: How do I do a regex search in Nokogiri for text that matches a certain beginning?
body: <p>Given: </p>
  
  <pre><code>require 'rubygems'
  require 'nokogiri'
  value = Nokogiri::HTML.parse(&lt;&lt;-HTML_END)
  "&lt;html&gt;
  &lt;body&gt;
    &lt;p id='para-1'&gt;A&lt;/p&gt;
    &lt;div class='block' id='X1'&gt;
      &lt;h1&gt;Foo&lt;/h1&gt;
      &lt;p id='para-2'&gt;B&lt;/p&gt;
    &lt;/div&gt;
    &lt;p id='para-3'&gt;C&lt;/p&gt;
    &lt;h2&gt;Bar&lt;/h2&gt;
    &lt;p id='para-4'&gt;D&lt;/p&gt;
    &lt;p id='para-5'&gt;E&lt;/p&gt;
    &lt;div class='block' id='X2'&gt;
      &lt;p id='para-6'&gt;F&lt;/p&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;"
  HTML_END
  </code></pre>
  
  <p>I want to do something like what I can do in Hpricot:</p>
  
  <pre><code>divs = value.search('//div[@id^="para-"]')
  </code></pre>
  
  <ol>
  <li>How do I do a pattern search for elements in XPath style?</li>
  <li>Where would I find the documentation to help me?  I didn't see this in the rdocs.</li>
  </ol>