Created
August 8, 2018 03:41
-
-
Save Szeraax/5caf097da7d98514b41c44071b65afb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[cmdletbinding()] | |
Param( | |
$UnzipSearch = '(?s)(<([^>]+)>.*?</\2>)', | |
$UnzipReplace = "`n`$1`n", | |
$SnipSnipSearch = '(?m)(?<=^<.*)`n', | |
$SnipSnipReplace = '', | |
$RezipSearch = "`n", | |
$RezipReplace = '' | |
) | |
$Tests = 'foo`n<ul>`n<li>Coffee</li>`n<li>Tea</li>`n<li>Milk</li>`n</ul>`nbar', | |
'<ul>`n<li>Coffee</li>`n<li>Tea</li>`n<li>Milk</li>`n</ul>', | |
'Keep `nme<b> No`nNo`nNo`nNo</b>Mamamia`nLETHIMGO<b>bo`nld</b>`nNext!', | |
'Keep `nme<b> No`nNo`nNo`nNo</b>Mamamia`nLETHIMGO<b>bold</b>', | |
'Keep `nme<b> No`nNo`nNo`nNo</b>Mamamia`nLETHIMGO', | |
'Finally' | |
$Tests | % { | |
$_ | |
"-"*20 | |
$_ -replace $UnzipSearch, $UnzipReplace -replace $SnipSnipSearch, | |
$SnipSnipReplace -replace $RezipSearch, $RezipReplace | | |
Write-host -ForegroundColor Green ; "="*30 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment