vb.net - 2 text box with validation of custom format and input, and comparing both data VB2010 -
i kinda stuck scenario! need create 2 text box same format of data "3xyz-02-01-abc-001" , need compare "3xyz-02-01-abc" popup text when not matches.
i using vb2010 , creating in winform,
unable use regex, don't know why? solution that? masked textbox solution , , appreciate. bit of challenge!
thanks
to validate (boolean) without returning string, check both conditions.
public function validatecode(code string) boolean dim test string = "" ' longer code check test = "\d[a-z]{3}-\d{2}-\d{2}-[a-z]{3}-\d{3}" ' regex or operator test = test & "|" ' shorter code check test = test & "\d[a-z]{3}-\d{2}-\d{2}-[a-z]{3}" ' perform regex test , return boolean return regex.ismatch( code, test ) end function
Comments
Post a Comment