title: Regular Expression that validates a list of port numbers (1-65535) across multiple lines
body: <p>I am looking for a regular expression to match valid port numbers (1-65535) listed in a text area. The input will look like this:</p>
  <pre><code>80
  80
  25
  53
  110
  ---
  ---
  </code></pre>
  <p>and so on, so I need an expression that is able to handle validation in this way. Across multiple lines, unlimited times, be it that the user will be able to list as many port numbers as they need.. I have already taken a crack at writing my own expression and also using and expression I found.</p>
  <pre><code>^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$
  </code></pre>
  <p>which only does about half of what I need. Validates the number perfectly. but breaks as soon white space or a new line is created. Help would be greatly appreciated. Thanks.</p>