I've writing a regex for validating decimal values.
These are the conditionals:
Decimal values can have a + or -
The value can have either a dot or a comma as the decimal separator
The maximum number of digits before the decimal separator is 8
The maximum number of digits after the decimal separator is 3
This is the regex i've written but it somehow doesn't seem to work..I'm writing this inside a Inputfilter in android and matcher.matches() returns true for 999999999 etc.
You don't need the pipe character between the comma and dot in that character class. Not unless the pipe character (which is not a metacharacter inside a character class) is also acceptable as a decimal delimiter.
As it stands, your regex will match "9999|99" which is probably not what you want.
There are no new questions, but there may be new answers.