我想知道是否可以在PowerShell中使用RegEx来获得所需的内容,或者是否需要为每个字符解析例程编写一个字符。
$TextToParse1 = "ONE = function(A,B,function(C,D),E);"
# I would like to get the first function parameters in an array => $ParseParams = @('ONE','',('A','B','function(C,D)','E'))
$TextToParse2 = "TWO=Z:function(A,B,function(C,D),E,F,G);"
# I would like to get the first function parameters in an array => $ParseParams = @('TWO','Z:',('A','B','function(C,D)','E','F','G'))
$TextToParse3 = @"
THREE = function(
A,
B,
function(C,D),
E);
"@
# I would like to get the first function parameters in an array => $ParseParams =@('THREE','',('A','B','function(C,D)','E'))
$TextToParse4 = @"
FOUR = function(
A,
B,
function(
C,
D
),
E);
"@
# I would like to get the first function parameters in an array => $ParseParams =@('FOUR','',('A','B','function(C,D)','E'))