c# regex matches example

后端 未结 6 2146
耶瑟儿~
耶瑟儿~ 2020-12-01 11:46

I am trying to get values from the following text. How can this be done with Regex?

Input

Lorem ipsum dolor sit %download%#456 amet, consect

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 12:24

    Regex regex = new Regex("%download#(\\d+?)%", RegexOptions.SingleLine);
    Matches m = regex.Matches(input);
    

    I think will do the trick (not tested).

提交回复
热议问题