title: How would I make this preg_match() reg expression ignore whitespace?
body: <p>I have this regular expression: </p>
  
  <pre><code>if(preg_match("/^(\\d+)(,)(\\d+)$/") ) { ... }
  </code></pre>
  
  <p>which tests that the user has entered a pair of numbers separated by a comma (e.g. 120,80). I've got that part working properly. However I anticipate that users may accidentally enter white space between any of the characters. I would like to make the expression ignore ALL white space characters, no matter where they occur in the pattern. I've tried this: </p>
  
  <pre><code>if(preg_match("/x^(\\d+)(,)(\\d+)$/x") ) { ... }
  </code></pre>
  
  <p>And also this: </p>
  
  <pre><code>if(preg_match("/(^(\\d+)(,)(\\d+))$/x") ) { ... }
  </code></pre>
  
  <p>But nothing seems to work. Any insights would be greatly appreciated. BTW I'm still learning this stuff so take that into account! Thanks. :D</p>