A lesson learnt...
Resource file names are case sensitive :-), in other words,
Dim
stream As System.IO.Stream = _[Assembly].GetExecutingAssembly.GetManifestResourceStream("MarkItUp.RegexSnippets.Templates.xml")
Is 100% != to:
Dim
stream As System.IO.Stream = _[Assembly].GetExecutingAssembly.GetManifestResourceStream("MarkItUp.RegexSnippets.templates.xml")
Lesson learnt :-)
I also came up with this expression to extract namespace and classname information from a text file:
Dim pattern As String = "^(?:\s)*?namespace(?:\s)*?\b(?'namespace'\w+(?:\.\w+)+?)(?:\s)*?\{(?:[\s\S]*?)class(?:\s)*?\b(?'classname'\w+)(?:\s)*?\{"Dim m As Match = Regex.Match(codeSnippet, pattern, _
RegexOptions.Multiline Xor RegexOptions.Singleline Xor RegexOptions.IgnoreCase)
If m.Success Then
If m.Groups("namespace").Success Then
nspace = m.Groups("namespace").Value
End If
If m.Groups("classname").Success Then
classname = m.Groups("classname").Value
End
End If