I need regular expression in powershell to split string by a string ## and remove string up-to another character (;).
I have the following string.
$temp = "[email protected]## deliver, expand;[email protected]## deliver, expand;[email protected]## deliver, expand;"
Now, I want to split this string and get only email ids into new array object. my expected output should be like this.
[email protected]
[email protected]
[email protected]
To get above output, I need to split string by the character ## and remove sub string up-to semi-colon (;).
Can anyone help me to write regex query to achieve this need in powershell?.


[regex]::Split($temp, '##[^;]*;'), too, but you'd need to remove leading/trailing'##[^;]*;'to get rid of empty values.