using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace testreg
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
void Regex_string(string Str_text,string Str_y,string Str_n,string Str_reg)
{
if (Regex.IsMatch(Str_text, Str_reg))
{
MessageBox.Show(Str_y);
}
else
{
MessageBox.Show(Str_n);
}
}
private void button1_Click(object sender, EventArgs e)
{
Regex_string(textBox1.Text.Trim(), "有漢字", "沒漢字", @"[^\x00-\xff]");
}
private void button2_Click(object sender, EventArgs e)
{
Regex_string(textBox2.Text.Trim(), "是", "否",