I would recommend using (.*?)
instead of ([^.]*?)
.
It looks want you want is "between [h1]
and [/h1]
match anything." That would be (.*?)
.
What you have is "between [h1]
and [/h1]
match anything which is not a period (.
)."
In addition, you have a problem with your ending [/h1\\]]
means end with a /
, h
, 1
, or ]
. I think you want \\[/h1]
which means end with the string [/h1]
.
The final regex would be @"\\[h1](.*?)\\[/h1]"
.