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

前端 未结 7 970
难免孤独
难免孤独 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条回答
  •  旧时难觅i
    2020-12-01 12:47

    Little bit modifying the answer of @Milosz Krajewski

    (?<=\{)[^}{]*(?=\})
    

    this will skip the middle single opening and closing Curly braces in the string.

提交回复
热议问题