I'm trying to use a regular expression to replace the first character after a single hit, while using PowerShell.
No matter how I try, I can't seem to make it work. Here's what I'm talking about:
Code:
$info = 'AB/F/*ZXCVBN/MTF/ ---'
$regex = [REGEX]'/*'
$regex.Replace($info,"/C",1)
$regex
Output:
/CAB/F/*ZXCVBN/MTF/ ---
I'm simply trying to replace the /F in the expression with /C, but it fails every time.
I'm using /* since I don't really know what character will I find after the first / but that's what I want to replace in the end of the day.
I pretty sure this will be pretty simple but, as you can see, I'm, just not familiar enough with regular expressions.
*and use/\*instead?