Ad
Regular Expressions
Declarative Programming
Advanced Language Features
Programming Paradigms
Fundamentals
Strings
Code
Diff
  • wordCount=s=>s.trim().match(/[^\W_]+/mg).length;
    • wordCount=s=>s.trim().match(/[A-Za-z0-9]+/mg).length;
    • wordCount=s=>s.trim().match(/[^\W_]+/mg).length;