I want to check for percentage between 20 to 50 (both included and decimals are allowed as well) in my JS code.
I created a regex for this /^[2-4]\d(\.\d\d?)?|50(\.00?)?$/
This regex successfully works, but I need to add this to JSON file, so I'm escaping it.
Escaped regex is /^[2-4]\\d(\\.\\d\\d?)?|50(\\.00?)?$/
Now the issue is that escaped regex is not working to detect the required values.
Any help is appreciated