Painting Blue Code
Simple, self-explanatory code snippets.
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment