I am parsing a string into XML with powershell:
NODE IP 0.0.0.0 "APXPRD"
And I need to got:
<NODE_IP>0.0.0.0 "APXPRD"</NODE_IP>
I try to use regexp, but cant catch how to replace ' ' to '_' only if it between words in all capital letters, any advice?
I Try like that regexp:
$textis = 'NODE IP 0.0.0.0 "APXPRD"'
$textnew = $textis.replace('/^\s*[A-Z]+(?:\s+[A-Z]+)/m', '_')
but that seems not work :/