using System; using System.Text.RegularExpressions; namespace WebApplication5 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lb.Text = "ares@xizhang.com 555 ares@microsoft.com"; } } protected void submit_Click(object sender, EventArgs e) { string temp = lb.Text; lb.Text = Regex.Replace(temp, @"[\w\.=-]+@[\w\.-]+\.[\w]{2,3}", c => { return string.Format("{0}", c); }); } } }