First time posting.
i have the following code to replace the suffix of an email and its working fine
replace all characters after @ sign with @testdomain.com
$a = 'john.doe@domain.com'
$b = $a -replace "[?=@].*", '@testdomain.com'
$b
john.doe@testdomain.com
what i would like to do, is to capture the actual left side 'source' regex expression to a variable, which would be @domain.com so that i know what i;m replacing and i don;t know how to do it.
Sorry if this had been posted before.
Thank you