1.引用名称空间 using system.text.regularexpressions; 2.代码:
string strinput="[email protected]"; string [email protected]"/w+([-+.]/w+)*@/w+([-.]/w+)*/./w+([-.]/w+)*" // create a new regex object. regex r = new regex(strexp); // find a single match in the string. match m = r.match(strinput); if (m.success) { messagebox.show("验证成功!"); }