我有一些旧的.NET代码,用于在sql字符串中搜索参数
System.Text.RegularExpressions.MatchCollection collection = System.Text.RegularExpressions.Regex.Matches(icmd.CommandText, "(#,?,:)[a-zA-Z0-9]*_*");
我不知道它是如何匹配的.有人能解释一下吗?
见下图解释它.
更新:在下面的代码#,,:abc12_
是匹配.
System.Text.RegularExpressions.MatchCollection collection = System.Text.RegularExpressions.Regex.Matches("#,,:abc12_", "(#,?,:)[a-zA-Z0-9]*_*");