Skip to content

Instantly share code, notes, and snippets.

@rasimmers
Created August 22, 2016 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasimmers/a137f81683a18104ab06c4c3b696cdee to your computer and use it in GitHub Desktop.
Save rasimmers/a137f81683a18104ab06c4c3b696cdee to your computer and use it in GitHub Desktop.
$test = @"
blah
blah
blah
Added "tag" to HTML tags to ensure the forum doesn't strip the tags
<htmltag>
<headtag>
<titletag>Some HTML content</titletag>
</headtag>
<bodytag>
blah blah blah
</bodytag>
</htmltag>
"@
#http://stackoverflow.com/questions/7167279/regex-select-all-text-between-tags
$pattern = "<htmltag>(.|\n)*?<\/htmltag>"
[regex]::matches($test,$pattern).Value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment