title: Extract URL where text matches a regex - with XPath 1.0
body: <p>I would like to extract the URL of this type (link text is a number with any number of digits and href is a random text) using an XPath in Scrapy. </p>
  
  <ul>
  <li><code>&lt;a href="http://www.example.com/link_to_some_page.html&gt;3&lt;/a&gt;</code></li>
  <li><code>&lt;a href="http://www.example.com/another_link-abcd.html&gt;45&lt;/a&gt;</code></li>
  </ul>
  
  <p>I could think of something like </p>
  
  <pre><code>HtmlXPathSelector(response).select('//a[matches(text(),"\d+")]/@href')
  </code></pre>
  
  <p>However it appears that XPath 2.0 isn't supported and I can't use regex. </p>
  
  <p>The best single line solution I could search was from this question: <a href="https://stackoverflow.com/q/597944/781695">xpath expression for regex-like matching?</a> - Is there a better way in scrapy to achieve this? </p>