如果一行内多个,类似
12一共1非常32这样的,可以用
((?<=\D)|^)\d{1,2}((?=\D)|$)
取出每一项

解决方案 »

  1.   

    \d|[1-9][1-9]
      
    //////////////////////////////////////////////
    MSN:[email protected]请给我一个与您交流的机会!
      

  2.   

    wuyazhe(经常答错,欢迎指正。) 
    你答对了,但是1-25怎么表示呢
      

  3.   

    string sourceString = @"99";
    string pattern = @"^[1-9]?\d$";
    System.Text.RegularExpressions.Match result = Regex.Match(sourceString,pattern,System.Text.RegularExpressions.RegexOptions.IgnoreCase);

    if (result.Success)
    {
    //提示正确信息
    //WL("正确:" + result.Groups[1].Value);//输出
    WL("正确:" + result.Value);//输出
    }
    else
    {
    //提示错误信息
    WL("错误!");//输出
    }
      
    -------------------------------------------
    MSN:[email protected] 
    请给我与您交流的机会