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

求一个正则表达式.字符里有括号咋匹配?比如:l like the(123)
l like the(123)
l like the(12)
l like the(333)
l like the(55)
l like the(567)
只有括号中的在变.这样的咋匹配出来?

------解决方案--------------------
是取括号里的东西吗?
------解决方案--------------------
用正则,很简单的
String pattern=@"l like the\(\d*)";



------解决方案--------------------
C# code

@"I like the \([^)]+\)"

------解决方案--------------------
\转义字符即可
@"I like the \([^)]+\)"