JavaScript Regex - check for enum value : <p>Currently I have a text field that allow user to enter an <code>Enum</code> value. Once they enter a value I need to validate those value first and throw an error message if not match.</p>

<p>The <code>Enum</code> format will be -
</p>

<pre><code>yes|no|maybe#yes
yes | no | maybe #yes
1|2|3|4|5#0
</code></pre>

<ol>
<li>string must have <code>|</code> symbol, so in the future I able to split the characters.</li>
<li><code>#</code> symbol and the end. This will be a "default value" for enum. </li>
</ol>

<p>How to create this regex? Thanks in advance.</p>


