Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function extract(content) {
- let text = document.getElementById('content').textContent;
- let pattern = /\([^)]+\)/g;
- let words = [];
- let matches = text.match(pattern);
- for (let match of matches) {
- words.push(match.slice(1, match.length - 1));
- }
- return words.join(', ');
- }
Advertisement
Add Comment
Please, Sign In to add comment