【发布时间】:2017-03-22 05:42:51
【问题描述】:
我需要验证一个应该接受诸如“ab123cd”、“xy12345”、“a567891”之类的字符串的文本框。如何编写正则表达式来满足此要求?接受字符串的长度不应超过 7 个字符。字符串中不应有任何特殊字符或空格。
while(textbox.text does not match the requirement)
{
MessageBox.Show("Please enter Valid string");
prompt.ShowDialog(); //displaying a Dialog box that shows a textbox
}
还帮我编写如上所示的代码。 谢谢!!
【问题讨论】: