I need an input form that works with money. You can't type text, symbols, or anything besides numbers but you also shouldn't be able to put $0. It should be $1 and up. When I put /^[0-9\b]+$/
it only allows numbers but you can put $0. When I use /^[1-9\b]+$/
it doesn't let you put in a zero but if you type 1 and try to put a zero it won't let you. When I try /^[1-9\b]+/
, it doesn't allow zero but now you can type text and characters. Is there a better way to do this?
const re = /^[0-9\b]+$/
is the current regex I'm using.
This is in ReactJS