title: Limiting RegEx to match only a string of 1-254 characters length
body: <p>This is my RegEx:</p>
  
  <pre><code>"^[^\.]([\w-\!\#\$\%\&amp;\'\*\+\-\/\=\`\{\|\}\~\?\^]+)([\.]{0,1})([\w-\!\#\$\%\&amp;\'\*\+\-\/\=\`\{\|\}\~\?\^]+)[^\.]@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$"
  </code></pre>
  
  <p>I need to match only strings less than 255 characters.</p>
  
  <p>I've tried adding the word boundaries at the start of the RegEx but it fails:</p>
  
  <pre><code>"^(?=.{1,254})[^\.]([\w-\!\#\$\%\&amp;\'\*\+\-\/\=\`\{\|\}\~\?\^]+)([\.]{0,1})([\w-\!\#\$\%\&amp;\'\*\+\-\/\=\`\{\|\}\~\?\^]+)[^\.]@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$"
  </code></pre>