Jump to content
Sign in to follow this  
mlloz

StringRegExpReplace

Recommended Posts

mlloz

is that correct? or how to correct it?

StringRegExpReplace($HostText, '[.(0-9)\t]' & 'Server', $NewIP)

'[.(0-9)\t]' & 'Server' represent an IP Address followed by a tab then the name of the machine,

$NewIP contains the replacement text.

Share this post


Link to post
Share on other sites
Zedna

$HostText = 'some text 192.168.20.48' & @TAB & 'Server'
$NewIP = '10.10.10.25'
ConsoleWrite($HostText & @CRLF)

$HostText = StringRegExpReplace($HostText, '([0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3})\tServer', $NewIP & @TAB & 'Server')
ConsoleWrite($HostText & @CRLF)

Edited by Zedna

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×