regex - Regular expression for asp.net -
i need in regular expression. validating textbox text when updating records. when click update button, first 5 letters should equal cm000 or cm000. how validate using regular expression in asp.net. know validationexpression this. let me know .
thanks
you don't need regex - instead:
bool isvalid = textbox.text.startswith("cm000", stringcomparison.ordinalignorecase);
if must use regex (like validation control) use this:
<asp:regularexpressionvalidator runat="server" id="someid" controltovalidate="textbox" validationexpression="^(?:cm|cm)000" errormessage="invalid input" />
Comments
Post a Comment