Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(params) {
- let [firstPart, secondPart, thirdPart] = params[0].split('|');
- let asciiSymbols = firstPart.match(/([#$%*&])([A-Z]+)(\1)/)[2]
- .split('')
- .map(c => c.charCodeAt(0));
- asciiSymbols.forEach(s => {
- let length = secondPart.match(new RegExp(`${s}:([0-9]{2})`));
- length = Number(length[1]);
- let match = thirdPart.match(new RegExp(`(^|\\s)(${String.fromCharCode(s)}.{${length}})($|\\s)`));
- console.log(match[0])
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement