title: Extracting Number from a string using Selenium IDE
body: <p>I've looked at dozens of answers to this question, and tried all of them, but can't get any of them to work.  I'm sure it's something very simple, but here's what I'm trying to  do; </p>
  
  <p>I need to extract a numeric value from a string, then compare it to see if it is greater than or equal to a number.  I am using Selenium IDE. </p>
  
  <p>The string is simple <code>XXX Total matches</code> where <code>XXX</code> is the number.  I've stored this string using <code>storeText</code>, storing it in a variable named appropriately enough, String. </p>
  
  <p>I then  run  an <code>echo</code> command to display "String" to make sure I've got that part correct, and it displays the "XXX Total matches" string as expected. </p>
  
  <p>I have tried several methods mentioned on extracting the number part of the string, including regexp, javascript, etc.  </p>
  
  <p>The one that "seems" to work is <code>storeeval | String=String.slice(0, 2); | Number</code>, but when I try to echo Number, it shows nothing.  </p>
  
  <p>I've tried </p>
  
  <pre><code>javascript{(${String}.match(/\\d+/))}
  
  javascript{parseInt(${String}, 10);}
  
  javascript{parseInt(${String})}
  </code></pre>
  
  <p>But when I try those, I get an error in selenium IDE </p>
  
  <pre><code>[error] Unexpected Exception: fileName -&gt; chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -&gt; 2531
  </code></pre>
  
  <p>I'm sure it's probably a basic newbie mistake, but I can't figure out what I'm doing wrong. </p>