Detect HTML links

  • + 0 comments

    Javascript solution:

    const lines = input.matchAll(/<a\s+href=['"]?(.*?)['"\s].*?>\s*([^<].*?)</g);
    for (const line of lines) {
      const output = `${line[1].trim()},${line[2].trim()}`;
      console.log(output);
    }