Skip to content

Instantly share code, notes, and snippets.

@cbxia
Last active June 22, 2016 09:55
Show Gist options
  • Save cbxia/821096c0b31148bf075778e7b6f67f87 to your computer and use it in GitHub Desktop.
Save cbxia/821096c0b31148bf075778e7b6f67f87 to your computer and use it in GitHub Desktop.
// This pattern matches the xml element in paragraph that follows:
Regex _xmlElementPattern = new Regex(@"<xml>(.|\n)+?</xml>", RegexOptions.Multiline);
/* =============Sample input text ===============
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dwindows-125=
2">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 14">
<meta name=3DOriginator content=3D"Microsoft Word 14">
<link rel=3DFile-List href=3D"wgtf5lot.b5k_fichiers/filelist.xml">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><!--[if gte mso 9]><xml><![endif]-->
<link rel=3DdataStoreItem href=3D"wgtf5lot.b5k_fichiers/item0001.xml"
<o:DocumentProperties>
<o:Author>Morgan</o:Author>
<o:LastAuthor>Morgan</o:LastAuthor>
<o:Revision>7</o:Revision>
<o:TotalTime>10</o:TotalTime>
<o:Created>2016-05-27T08:28:00Z</o:Created>
<o:LastSaved>2016-05-27T08:28:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>153</o:Words>
<o:Characters>844</o:Characters>
<o:Company>ibm</o:Company>
<o:Lines>7</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>996</o:CharactersWithSpaces>
<o:Version>14.00</o:Version>
</o:DocumentProperties>
<o:CustomDocumentProperties>
<o:ContentTypeId dt:dt=3D"string">0x01010070A6962DCB5A44D7B0BD2EC14BF1383=
A002BBE671792C1E04CAF70EB620F2F9ECC</o:ContentTypeId>
</o:CustomDocumentProperties>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<link rel=3DdataStoreItem href=3D"wgtf5lot.b5k_fichiers/item0001.xml"
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment