title: Regex for leading Characters
body: <p>I have a textbox to accept string.
  I want to put a validation in that like, if character <code>X</code> is there in string it should be at last, not in the middle. But <code>X</code> can repeat many times. A string may have 5 <code>X</code> or 10 <code>X</code>, but all <code>X</code> must be at last not in the middle of string.</p>
  
  <p>For e.g.:</p>
  
  <p><code>testingxxxx</code>  This is correct string because all <code>X</code> are at last.</p>
  
  <p><code>test_x_ingxxxxx</code> This is Invalid because <code>X</code> is in between the string.</p>
  
  <p><code>testX</code> This is Valid because <code>X</code> at last</p>
  
  <p><code>XtestXXXX</code> This is Invalid because <code>X</code> at starting position.</p>