I have a regex which is already used in system
/^(?![.,])(?!.*[.,]$)[0-9.,](?!.*[.,]{2}).*$/ I need to validate the same for accepting 15 digits. User might enter decimal or might not. I am not able to understand how to handle that condition.
I tried adding the limit like this
/^(?![.,])(?!.*[.,]$)[0-9.,](?!.*[.,]{2}).{1,15}$/ Can someone help me with understanding how to handle decimal and still be able to check if 15 digits are entered for max length. More than 15 digits should throw error and less should be acceptable.