I've a textbox for name field where I've used asp validation for proper name format. I want to validate multiple spaces between the strings. How can I do that? The leading and trail spaces are removed by trim() function but how can I validate multiple spaces between the strings? like
multiple spaces
no space
My validation code::
<label>
<span>Full name</span>
<input type="text" id="txt_name" runat="server" required="required"/>
<asp:RegularExpressionValidator ID="rev_txt_name" runat="server" ControlToValidate="txt_name" ForeColor="Red"
ErrorMessage="Invalid name!" SetFocusOnError="True" ValidationExpression="^[a-zA-Z'.\s]{2,50}"></asp:RegularExpressionValidator>
</label>
"one two three"is valid and"one<SPACE><SPACE>two<SPACE><SPACE>three"is not?^[a-zA-Z'.]+(?:\s[a-zA-Z'.]+)*$. If not,^(?=.{2,50}$)[a-zA-Z'.]+(?:\s[a-zA-Z'.]+)*$.