Function MatchFunc(ByVal M as Match) as String 'Get numeric temperature from $1, then convert to Fahrenheit Dim Celsius as Double = Double.Parse(M.Groups(1).Value) Dim Fahrenheit as Double = Celsius * 9/5 + 32 Return Fahrenheit & "F" 'Append an "F", and return End Function Dim Evaluator as MatchEvaluator = New MatchEvaluator(AddressOf MatchFunc) Dim R_Temp as Regex = New Regex("(\d+)C\b", RegexOptions.IgnoreCase) Target = R_Temp.Replace(Target, Evaluator) ----------------------------------------------------------------------------- Copyright 1997-2024 Jeffrey Friedl