Pijomir

Untitled

Jan 23rd, 2024
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function extract(content) {
  2.     let text = document.getElementById('content').textContent;
  3.     let pattern = /\([^)]+\)/g;
  4.     let words = [];
  5.     let matches = text.match(pattern);
  6.     for (let match of matches) {
  7.         words.push(match.slice(1, match.length - 1));
  8.     }
  9.     return words.join(', ');
  10. }
Advertisement
Add Comment
Please, Sign In to add comment