Jquery count only numbers in a string

javascript, jquery, php

Solution

You could use .match() with `/\d/g` Regular Expression:

"(55)-555-34".match(/\d/g).length
//result=>7

Problem

My question is: How I can count only numbers from a string, for example if I have: (55)-555-34 to get output 7, I mean to exclude the dashes and brackets for example. Cheers!

Original source