我想将“,< *”替换为“*<”在行的开头和结尾“*>”用“> *”。以下命令无效。请协助。
$inputmatch = ",<*abc*>,<*>,<*abc*>,<*abc*>"
$inputmatch = $inputmatch -replace "^\,\<\*","\*\<"
$inputmatch = $inputmatch -replace "\*\>$","\>\*"
答案 0 :(得分:2)
$inputmatch = ",<*abc*>,<*>,<*abc*>,<*abc*>"
$inputmatch -replace '^,<\*','*<' -replace '\*>$','>*'
*<abc*>,<*>,<*abc*>,<*abc>*