Hi, Try This. It will help u.
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs ex)
{
string Content1 = "a_b";
string Content2 = "a_@";
string pattern = @"[A-Za-z]_[A-Za-z]";
Regex.IsMatch(Content1, pattern);
Regex.IsMatch(Content2, pattern);
}
}
}