extension PriceValidator on String {
bool isValidPrice () {
return RegExp(r'^(\d{1,3}(\.\d{3})*|(\d+))*(\.\d{3})$').hasMatch(this);
}
}
I used this regular expression to get me this data when publishing a product:
5,000
10,000
245,000
1,000,000
25,000,000
240,000,000
and it gives me this data:
5, 10, 245, 1,25,240,