C# RegEx string extraction

前端 未结 5 687
孤街浪徒
孤街浪徒 2020-12-05 06:06

I have a string:

\"ImageDimension=655x0;ThumbnailDimension=0x0\".

I have to extract first number (\"655\" string) coming in be

5条回答
  •  眼角桃花
    2020-12-05 06:59

    Sure, it's pretty easy. The regex pattern you're looking for is:

    ^ImageDimension=(\d+)x0;.+$
    

    The first group in the match is the number you want.

提交回复
热议问题