I will use it in Delphi 10.1. I was able to reach the expression below, but for lack of knowledge and practice, I'm not getting as far as I want.
Regex:
^(^[\-]?[1-9]|0)(?:[0-9]{0,10}|0)(?:,\d{0,2})?$
I need to analyze whether the number is a valid monetary value, that is just numbers, no space, no thousand separator or currency symbol, has none, one or even two decimal places, and that I accept positive (minus sign) and negative (preceded by -), accepting zero if it is the only number, but not zero at the beginning if it is integer or fractional, but accepts zero at the beginning if the zero is the only one previous to the comma and the fractional part is greater than one cent.
You should accept:
0
0,//Será formatado após
0,0
0,00
0,01 até 0,99
0,1
1234567890,99
-1234567890,99
-0,01 até -0,99
1,00
-1,00
You can not accept:
-0
-0,
-0,00
-,01 a -,99
//Sequencia vazio
01,00
01
0012