Regex problem
-
(?mx-s:\#region\b
(?.*)
(?(?> \\#region\\b.\* (?) | \\#endregion\\b (?<-djup>) | \[^\\#\]+ )+ (?(djup)(?!))
)
\#endregion\b.*
)This is my pattern, it gets the content of #region sections. It works perfectly in Expresso, but when i run it on the same code in C# it does not!
const string GET_REGIONS = @"(?mx-s:\#region\b
(?.*)
(?(?> \\#region\\b.\* (?) | \\#endregion\\b (?<-djup>) | \[^\\#\]+ )+ (?(djup)(?!))
)
\#endregion\b.*
)
";MatchCollection regions = Regex.Matches(classContent, GET_REGIONS); // <- Does not work
Any ideas about what im doing wrong? :confused::confused:
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
-
(?mx-s:\#region\b
(?.*)
(?(?> \\#region\\b.\* (?) | \\#endregion\\b (?<-djup>) | \[^\\#\]+ )+ (?(djup)(?!))
)
\#endregion\b.*
)This is my pattern, it gets the content of #region sections. It works perfectly in Expresso, but when i run it on the same code in C# it does not!
const string GET_REGIONS = @"(?mx-s:\#region\b
(?.*)
(?(?> \\#region\\b.\* (?) | \\#endregion\\b (?<-djup>) | \[^\\#\]+ )+ (?(djup)(?!))
)
\#endregion\b.*
)
";MatchCollection regions = Regex.Matches(classContent, GET_REGIONS); // <- Does not work
Any ideas about what im doing wrong? :confused::confused:
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.
It worked when i used Expressos generate C# code ^__^
fafafa, ringakta icke sådant som bringa ack så naggande högönsklig välmåga å baronens ära.