Switch -Regex in Powershell.
Posted
by CrazyNick
on Stack Overflow
See other posts from Stack Overflow
or by CrazyNick
Published on 2010-03-27T08:55:37Z
Indexed on
2010/03/27
9:03 UTC
Read the original article
Hit count: 362
$source |% {
switch -regex ($_){
**'\<'+$primaryKey+'\>(.+)\</'+$primaryKey+'\>**' {
$primaryKeyValue = $matches[1]; continue; }
}
I want to use dynamic key value with switch-regex, is that possible?
© Stack Overflow or respective owner