C# Regex.Match curly brackets- contents only? (exclude braces)

前端 未结 7 971
难免孤独
难免孤独 2020-12-01 12:17

I\'ve been unable to find an answer on this: can I use the Regex.Matches method to return only the contents of items with curly braces?

If I us

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 13:02

    If I understand what you want. Change the regex to {([^}]*)}. That will only capture the text between {}, not including them.

提交回复
热议问题