I need to extract cents value from next possible values using Java regex (thousand separator could be both dot and comma):
$123,456.78
123,456.78 dollars
123,456.78
I have partially working solution:
[\.,]\d\d\D
The problem with my solution, that it doesn't work in case "123,456.78" when the last digit is the end of string. How can I handle this case?
http://java-regex-tester.appspot.com/regex/6af08221-63cb-4c5b-a865-c86fe5e825ff