title: Allow one occurrence in regular expression
body: <p>I would like to restrict my regex with some characters like &lt; > @ # and allow only one occurrence of | character. So far I didn't have success.</p>
  
  <pre><code>^([^&lt;&gt;@#]+[|]?)$
  </code></pre>
  
  <p>Can't figure it out how to restrict my regex to only one occurrence of | char.</p>