【发布时间】:2018-03-18 07:19:33
【问题描述】:
请考虑这个字符串:
http://tempuri.org/IService1/GetData\
我想使用正则表达式获取GetData。我用这段代码测试它:
Regex regex = new Regex("\\/\\w*\\");
但我收到此错误:
System.ArgumentException: 'parsing "/\w*\" - Illegal \ at end of pattern.'
然后我测试这段代码:
Regex regex = new Regex(@"\/\w*\\");
但它不起作用并且无法识别任何匹配项。
我可以使用正则表达式在上面的字符串中识别GetData吗?
谢谢
【问题讨论】: