KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why this regex '^[0-9]+\.?[0-9]*$' match for 12.2 and 12,2 ? jsFiddle var dot = '12.2', comma = '12,2', regex = '^[0-9]+\.?[0-9]*$'; alert( dot.match(regex) ); alert( comma.match(regex) ); While it works on regexpal.com
Tags (comma-separated)
Save Edits
Cancel