SyntaxFix
Write A Post
Hire A Developer
Questions
I Tried this one and it worked for me for all decimal/integer numbers greater than zero
Allows white space: ^\s*(?=.*[1-9])\d*(?:\.\d{1,2})?\s*$
^\s*(?=.*[1-9])\d*(?:\.\d{1,2})?\s*$
No white space: ^(?=.*[1-9])\d*(?:\.\d{1,2})?$
^(?=.*[1-9])\d*(?:\.\d{1,2})?$
Reference: Regex greater than zero with 2 decimal places