日期:2014-05-18  浏览次数:20733 次

急求正则表达式?
{$A}
{$A1}
{$A11}

类似{$..}这样的正则表达式怎么写?
里面是一个大写字母加上0到2个数字

------解决方案--------------------
^\{\$[A-Z]\d{0,2}\}$
------解决方案--------------------
C# code

            string s = "{$A11}";
            System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(@"(?is)^\{\$[A-Z][\d]{0,2}\}$");
            System.Text.RegularExpressions.Match m = reg.Match(s);
            MessageBox.Show(m.Value);