VB2005: I've been looking at regex for some hours now and cant seem to get my head around the .Replace for my case. I'm looking for two fields and then I want to replace those fields with new values. So my string looks like so:
Dim myInputString as string ="RTEMP MIN<240 MAX<800"
My regex is
dim ptn as string = "RTEMP\s{17}MIN<(?<min>(\d|\s){1,3})\s{1,3}MAX<(?<max>(\d|\s){1,3})\s{1,12}"
Dim MyRegex As Regex = New Regex(ptn, RegexOptions.IgnoreCase)
and that works well and it captures my two fields. Now I have new values
dim newMin as integer = 300
dim newMax as integer = 999
But cant seem to figure out how to replace the two values in one swoop
Dim result As String = MyRegex.Replace(myInputString, MyRegexReplace)
What do I put in MyRegexReplace? This is a simple two value replace but Im going to have possibly more so was thinking there has got to be a way to do this but need help.
Thanks AGP