searching for text in middle of a string

I have a string 1234=4578

$S = “1234=4578”

How would I look up only “4578”

Also, where can I learn more about all these special regex conditions? I only know the basics now.

I couldn’t find anything in Google.

Your example is probably too simplistic, you’d want to define what the possible values could/should be to make a proper regex. You can test them here. I like this one more, but its unreachable for me at the moment.

In this case, you wouldn’t need to use a regex. You can split the string at the equal sign and select the 2nd item of the array returned by -split.

($S -split '=')[1]

If you want to use a regex the following simple pattern would work.

if ($S -match '=(.*)$') {

I hope above helps.

I couldn't find anything in Google.
Really? What did you search for? Regular Expressions