(\d+(?:\.\d+)?)\D*$
- this regex extracts price from any string with decimal point, but I want to extract decimal point only when there is something but not zero like when there is 300.50 or 300.25 then decimal point should be extracted but if there is 300.00 then the decimal point should not be extracted, what to do ?
This is ok, or any better solution is there ?
Match match = Regex.Match(cellRecord, @"(\d+(?:\.\d+)?)\D*$");
price = match.Groups[1].Value.ToString().Trim();
if (price.Substring(price.Length - 3, 3) == ".00")
{
price = price.Replace(".00", "");
}