Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Search and replace in powershell using wildcards

$
0
0

Hi

I'm trying to figure out how to replace a some random (ish) text, in a text string with a defined piece of text using Powershell.

The text I want to replace is always between the same two words but the actual text varies from device to device.

Lets say the text line is 

Server this bit of text varies Language

I want to replace the text between "Server" and "Language" with "it will always say this"

I want to write something like this


replace('Server'*'Language','Server it will always say this Language')


so whatever is between Server and language is replaced with "it will always say this".

I realise I've not got the regular expression correct. Can anyone help?

Cheers

Alex


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>