I have this enum defitiion in file:
public enum IdentityState
{
[EnumMember]
New = 0,
[EnumMember]
Normal = 1,
[EnumMember]
Disabled = 2
}
{ some other data... }
And want to match only body of this enum (between {}), the match result i want is:
{
[EnumMember]
New = 0,
[EnumMember]
Normal = 1,
[EnumMember]
Disabled = 2
}
I make regex pattern like this:
public enum.*\w.*(?<enumBody>[\S|\s|]+\}{1})
but result is this:
{
[EnumMember]
New = 0,
[EnumMember]
Normal = 1,
[EnumMember]
Disabled = 2
}
{ some other data... }
Which is not what i expect because it also include next { some other data }
string which i dont want. I dont know how make pattern to stop after first }
.