I am trying to get the total price from a receipt with Regex.
The formatting is:
TOTAL 15.40
The goal is only to get the price out of the string.
I started with TOTAL[ .0-9], but this only returned the word TOTAL.
I googled around and putted this one together but can't get it to work:
TOTAL(\\s+)(?<value>[.0-9]+)
I have made the following code:
sRegex = "TOTAL(\\s+)(?<value>[.0-9]+)";
Match match = Regex.Match(this.sHTMLResult, sRegex, RegexOptions.None);
if (match.Success)
Console.Out.WriteLine("regex good");
else
Console.Out.WriteLine("regex fail");
But the regex doesn't return a success.
I try to get it out of a HTML file formatted like this:
TOTAL 15.40
15.40. Check your inputs. is not a space, obviously.