Description |
This captures (for filters out non digits) numbers with or without commas (eg currency as above) in the correct order - the other examples I see here don't capture in right order for all combinations. It doesn't check lengths or leading digits or number of digits between commas- that is left as an exercise for the student.
First example gives:[4],[234],[567],[89]
Second gives:
[],[1],[234],[80]
rather than the incorrect:
[1],[],[234],[80] |