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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -