C#中使用正則

 
using System.Text.RegularExpressions;  
        private void button1_Click(object sender, EventArgs e)
        {
            string regPartten = textBox1.Text;
            Regex reg = new Regex(regPartten, RegexOptions.IgnoreCase | RegexOptions.Multiline);
            Match m = reg.Match(textBox2.Text);
            if (m.Success)
            {
                textBox3.Text = m.Groups[1].Value;
            }
        }  








附件列表

相關文章
相關標籤/搜索