how to write regular expression to validate a string using regex in C#
<p>I need to validate a user input based on condition. i wrote a regular expression to do so, but it's failing not sure why.
Can somebody point where i am making mistake?</p>

<pre><code>Regex AccuracyCodeHexRegex = new Regex(@"^[PTQA]((0|8)[01234567]){2}$");
</code></pre>

<p>This is what i am trying to validate(If the string is a subset of these strings then it is valid):</p>

<blockquote>
  <p>Phh, Thh, Qhh, Ahh where 'h' is a hex digit in the set {00, 80, 01, 81, 02, 82, 03, 83, 04, 84, 05, 85, 06, 86, 07, 87}</p>
</blockquote>

<p>Ex: P00 is valid
P20 is not valid</p>
