I just wanted to share with you one simple stupid snippet (please note, I am PowerShell newbie so have mercy and if there is any better way, please share in comments, thank you).
Because in my current work we need to parse and update some .aspx files (I will try to publish this later on my github), I am fiddling a bit with PowerShell and Regex and such stuff.
I wanted to split a row in processed .aspx file and I wanted to use multiple delimiters while splitting. But according to this :
you can’t use multiple delimiters as parameter, like say array of delimiters like I was used to in C# :
OK so without any further ado :
you can chain .Split in PowerShell like this :
$splittedRow = "<tag id='abcd' id2="efgh"></tag>".Split("""").Split("'") Write-Host $splittedRow
This will return string splitted with delimiter ” and ‘.