Advertisement
Kamend1

Untitled

Feb 27th, 2025
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(string) {
  2.     let regex = /#([A-Za-z]+)/g;
  3.     let matches = [...string.matchAll(regex)];
  4.     let result = matches.map(match => match[1]);
  5.  
  6.     if (result.length > 0) {
  7.         console.log(result.join('\n'));
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement