Last active
August 24, 2020 05:19
-
-
Save cakrads/50bbb5b61c89f7b52b8cac95859d24e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// maksimum 2 angka setelah koma | |
const regex = [ | |
{ | |
"desc":"min. 0 dan max. Big. Int", | |
"value":"/^\s*([0-9])\d*(?:,\d{0,2})?\s*$/g", | |
}, | |
{ | |
"desc":"min. 0,01 dan max. 100", | |
"value":"/^(?:100(?:,00?)?|[1-9](?:,\d{1,2})?|[1-9]\d(?:,\d{1,2})?|0(?:,[1-9]?|,[0-9][1-9]))$/g", | |
}, | |
{ | |
"desc":"min. 0,01 dan max. Big. Int", | |
"value":"/^(?:\s*([1-9])\d*(?:,\d{1,2})?\s?|0(?:,[1-9]?|,[0-9][1-9]))$/g", | |
}, | |
{ | |
"desc":"min. 5 dan max. 100", | |
"value":"/^(?:100(?:,00?)?|[1-9]\d(?:,\d{1,2})?|[5-9](?:,\d{1,2})?)$/g", | |
}, | |
{ | |
"desc":"min. 5 dan max. 99", | |
"value":"/^(?:[5-9](?:,\d{1,2})?|[1-4]\d(?:,\d{1,2})?)$/g", | |
}, | |
{ | |
"desc":"min. 5 dan max. Big. Int", | |
"value":"/^(?:[5-9](?:,\d{1,2})?|[1-9][0-9]{1,}(?:,\d{1,2})?)$/g", | |
}, | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment