I have text like the following two example strings
this book was sold for 12.00 on 12.12.2010
he paid 12.12.2010 , and puchased an amount of 15.00
Try this
\b\d+\.\d{2}(?!\.?\d)
See it here on Regexr
\b
is a word boundary, this ensures that there is a non word character (includes also digits) before the first digit.
\d+\.\d{2}
is at least one digit, followed by a dot and two other digits.
(?!\.?\d)
is a negative look ahead that ensures that there is no digit OR no dot followed by a digit ahead. This would allow the amount to be at the end of the sentence.
Working c# code:
String s = "this book was sold for 12.00 on 12.12.2010";
Regex r = new Regex(@"\b\d+\.\d{2}(?!\.?\d)");
Console.WriteLine(r.Matches(s)[0]);
Console.ReadLine();