title: How to use variables with regex?
body: <p>This is the input string: <code>23x^45*y or 2x^2 or y^4*x^3</code>.</p>
  
  <p>I am matching <code>^[0-9]+</code> after letter <code>x</code>. In other words I am matching <code>x</code> followed by <code>^</code> followed by numbers. Problem is that I don't know that I am matching <code>x</code>, it could be any letter that I stored as variable in my char array.</p>
  
  <p>For example:</p>
  
  <pre><code>foreach (char cEle in myarray) // cEle is letter in char array x, y, z, ...
  {
      match CEle in regex(input) //PSEUDOCODE
  }
  </code></pre>
  
  <p>I am new to regex and I new that this can be done if I define regex variables, but I don't know how.</p>