title: How to match numbers ranging from 400 to 550 with regex?
body: <p>I want to validate a numeric string that must only contain numbers ranging from <strong>400</strong> to <strong>550</strong>. </p>
  
  <pre><code>$x = "401";  // valid 
  $x = "551";  // invalid 
  </code></pre>
  
  <p>I want to only match the numbers between <strong>400</strong> and <strong>550</strong>. </p>
  
  <p>I tried the following pattern:</p>
  
  <pre><code>if(preg_match_all("/[400-550]+/",$x)); 
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>What is the regex pattern for matching numbers 400-550? </p>