using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
/* //已验证
string str = @"0379-65620543";
Regex rgx = new Regex(@"0\d{2,3}-\d{6,8}");
Regex rgx1 = new Regex(@"^0"); //以0开头
Regex rgx2 = new Regex(@"3$"); //以3结尾
Console.WriteLine(rgx2.IsMatch(str));
*/
/* //已验证
string[] str = { @"(0379)65624150", @"0379-65620543" };
Regex rgx = new Regex(@"0\d{2,3}-\d{6,8}|\(0\d{2,3}\)\d{7,8}");//注意括号要转义
Console.WriteLine(rgx.IsMatch(str[0]));
Console.WriteLine(rgx.IsMatch(str[1]));
*/
/* //已验证
string str = @"asdfgsfsasdghdjgfadsdsdgjd";
Regex rgx = new Regex(@"sd");
Console.WriteLine(rgx.Matches(str).Count); //4
*/

/* //已验证
string str = @"asdfgsfsasdghdjgfadsdsdgjd";
Regex rgx = new Regex(@"sd");
Console.WriteLine(rgx.Replace(str,@"_")); //a_fgsfsa_ghdjgfad__gjd 把所有sd变成_
*/
/*
string str = @"asdfgsfsasdghdjgfadsdsdgjd";
Regex rgx = new Regex(@"a");
string[] s = rgx.Split(str);
foreach(var i in s)
{
Console.WriteLine(i);
}
*/
string str = @"0379-65620543";
Regex rgx = new Regex(@".*");
Console.WriteLine(rgx.IsMatch(str));
}
}
}