2015-02-17

RegEx - Specific string/character count in javascript

// This returns 1
'aasdf'.match(/a+/g).length;

// This returns 2
'aasdf'.match(/a/g).length;

No comments:

Post a Comment