开发者

Need some help with a RegEx query

Given the following strin开发者_如何学Gog:

someObject.SomeFunction.parameters[0] = new Thing('ValueName', 0);

How to I get just the ValueName value? - using C#


You can use String.Substring method or using regex:

(?<=')(?:\\'|[^'])*(?=')

e.g.:

Regex.Match(input, @"(?<=')(?:\\'|[^'])*(?=')").Value
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜