Building a Smart IDE: Identifying comments

  • + 0 comments

    Javascript solution:

    const comments = input.match(/(\/\*.*?\*\/|\/\/.*?$)/gms);
    console.log(comments.join("\n").replace(/^\s+/gms, ''));