title: Regex pattern to see if a string contains a number in a range
body: <p>I'm trying to match a number between 400 and 499 anywhere in a string. For example, both:</p>
  
  <pre><code>string = "[401] One too three"
  string2 = "Yes 450 sir okay"
  </code></pre>
  
  <p>should match. Both: </p>
  
  <pre><code>string3 = "[123] Test"
  string4 = "This is another string"
  </code></pre>
  
  <p>should fail.</p>
  
  <p>What's the best way to write the regex? I wrote:</p>
  
  <pre><code>string =~ /\d{3}/
  </code></pre>
  
  <p>to see if the string contains a three digit integer. How can I see if that's within the range?</p>