Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

regex validate money

// Requires a decimal and commas
^$?(([1-9]d{0,2}(,d{3})*)|0)?.d{1,2}$

// Allows a decimal, requires commas
(?=.*d)^$?(([1-9]d{0,2}(,d{3})*)|0)?(.d{1,2})?$

// Decimal and commas optional
(?=.*?d)^$?(([1-9]d{0,2}(,d{3})*)|d+)?(.d{1,2})?$

// Decimals required, commas optional
^$?(([1-9]d{0,2}(,d{3})*)|0)?.d{1,2}$

// *Requires/allows X here also implies "used correctly"
Comment

PREVIOUS NEXT
Code Example
Javascript :: turn object into string javascript 
Javascript :: check the doc name in javascript 
Javascript :: jquery change font size 
Javascript :: html div scroll 
Javascript :: javascript reduce function to get sum of object value 
Javascript :: node downgrade windows 
Javascript :: js remove dollar sign from string 
Javascript :: javascript get first 2 char 
Javascript :: node js fetch 
Javascript :: automatically add typedef to module.exports vscode site:stackoverflow.com 
Javascript :: js check if element into view 
Javascript :: how to redirect programatically in nextjs 
Javascript :: document get element by tag 
Javascript :: how to check element has an attribute js 
Javascript :: js input trigger change event when set value with js 
Javascript :: how to check if jquery is loaded 
Javascript :: js get first space in string 
Javascript :: swap two numbers without temp in javascript 
Javascript :: jquery form serialized data 
Javascript :: open url in new tab javascript 
Javascript :: uppercase angular pipe 
Javascript :: javascript snumber two decimal places as string 
Javascript :: readable date in javascript 
Javascript :: javascript display block 
Javascript :: readonly attribute in html by javascript 
Javascript :: get first 10 items of array javascript 
Javascript :: javascript generate random string 
Javascript :: onMounted 
Javascript :: javascript image xss 
Javascript :: Valid Time javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =