how can I count the number of integers in a string using jQuery or javascript?
For example g66ghy7 = 3
I find this to look pretty/simple:
var count = ('1a2b3c'.match(/\d/g) || []).length
A RegExp will probably perform better (it appears):
var r = new RegExp('\\d', 'g') , count = 0 while(r.exec('1a2b3c')) count++;