-5

当我收到一个数字时,我想对照所有可能的投注组合检查它,例如

L( 24, 25, 26, 27)

如果我正在搜索数字 24 而不是 2,将返回 true,希望我很清楚,抱歉没有代码,我是新手。

4

2 回答 2

0
bool ChechResult(int value)
{
    String input = @"L( 24, 25, 26, 27)";
    String pattern = @"\d+";
    foreach (Match match in Regex.Matches(input, pattern))
    {
        if(value == int.Parse(match.Value))
        {
            return true;
        }
    }
    return false;
}
于 2013-03-26T16:31:26.090 回答
-1
bool foundMatch = Regex.IsMatch(subject, " " + 24 + "(?:,|\\))");
于 2013-03-26T16:30:33.557 回答