首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

正则表达式.字符里有括号咋匹配?比如:l like the(123)

2012-04-12 
求一个正则表达式.字符里有括号咋匹配?比如:l like the(123)l like the(123)l like the(12)l like the(333

求一个正则表达式.字符里有括号咋匹配?比如: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 \([^)]+\)"

热点排行