fork(1) download
  1. let arr = [
  2. "handOn",
  3. "hands",
  4. "hanDLes",
  5. "Handcuffs",
  6. "handmade",
  7. "in-hands",
  8. "HANDINGLY",
  9. ];
  10.  
  11. // Output: ['hands', 'hanDLes', 'Handcuffs', 'HANDINGLY']
  12.  
  13. let filter = arr.filter((ele) => {
  14. return ele.match(/^hand\w*(s|y|le)$/gi);
  15. });
  16.  
  17. console.log(filter);
  18.  
Success #stdin #stdout 0.04s 16916KB
stdin
Standard input is empty
stdout
hands,hanDLes,Handcuffs,HANDINGLY