开发者

Simle regex question, c#

I would like to know how to get only the numbers and the _ from "{\"id\":\"21432413214_124533451397\"}" using regular e开发者_JS百科xpressions in c#. Here for example, I want the "21432413214_124533451397"-part. Thanks!


It looks like you're trying to parse JSON. You can use the c# built in JSON deserializing utilities, if you're parsing a more complex object than what you've described above:

http://msdn.microsoft.com/en-us/library/bb412179.aspx


[0-9]+_[0-9]+ matches two numbers with an underscore between them.


The following should work:

@"""\d+_\d+"""
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜