I am using RegexExtract to extract a numberic value from text. I used the following regex [0-9]+(\.[0-9][0-9]?)?
from the below link but I found it is only extracting two values after the decimal place. I need also the number in front of it. Not sure why it isn't working. I've tried different variations of it as well.
Simple regular expression for a decimal with a precision of 2
The text I am pulling from isn't always the same length and is about 100 characters along. In the text is the following in which I need to pull the numerical value only (x.xx): Gmax = 2.3428
ThisWorkbook.Worksheets(Warn.MachBox.Value & "_C1").Range("B" & Duncan2 + 1).Value = RegexExtract(ThisWorkbook.Worksheets(Warn.MachBox.Value & "_C1").Range("C" & Duncan2 + 1).Value, "Gmax = [0-9]+(\.[0-9][0-9]?)?")
The current way I have it and the different variations I've tried are only returning 0.34 and excluding the value before the decimal, if there is one. I need 2.34.
Any suggestions are greatly appreciated. Thanks!
Edit: Forgot to add the RegexExtract function info. This was found at the below link: How to extract text within a string of text