求:0-9999 的正则表达式 怎么写 用正则式做什么,简单的一个判断就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System;using System.Text.RegularExpressions;namespace ConsoleApplication4{ /// <summary> /// Class1 的摘要说明。 /// </summary> class Class1 { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main(string[] args) { Regex reg=new Regex("[0-9]{1,}"); string str="12"; if(str.Length<=4) { Match m=reg.Match(str); if(m.Success) { Console.WriteLine(" your input {0} is Success",str); } } str="123456"; if(str.Length<=4) { Match m=reg.Match(str); if(m.Success) { Console.WriteLine(" your input {0} is Success",str); } } Console.ReadLine(); } }} winform程序关于数据库问题 asp.net调试技巧,谢谢大家哦 FTP服务器,非常急啊!!!!!!!!!急!急急!!急急急!!!急急急急!!!! 怎样在一个窗体里关闭另一个窗体 谁那儿有wrox出版社的《c# web应用程序入门经典》的原码? 各位大虾,谁有c#方面的电子书,请告知在下啊 如何设置默认输入法为半角状态, 如何将string转换成Stream? c#控制太经典程序求解 C#中类的问题! c#中能不能自动加上“}”? 这种项目是否可以这样做?
namespace ConsoleApplication4
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Regex reg=new Regex("[0-9]{1,}");
string str="12";
if(str.Length<=4)
{
Match m=reg.Match(str);
if(m.Success)
{
Console.WriteLine(" your input {0} is Success",str);
}
}
str="123456";
if(str.Length<=4)
{
Match m=reg.Match(str);
if(m.Success)
{
Console.WriteLine(" your input {0} is Success",str);
}
}
Console.ReadLine();
}
}
}