Feedback for Intermediate Algorithms: Convert HTML Entities

Hi there,
See my Code below and give me some feedback please. How good is this solution? Is there a possibility to convert my switch statement into a regex? Or is if/switch necessary if I have to alternate the responde for my regex queries?


function convertHTML(str) {
let result = str.replace(/(&)|(<)|(>)|(")|(')/g, (match, p1, p2, p3, p4, p5) => {
  switch(match) {
    case p1:
      return "&amp;";
    case p2:
      return "&lt;";
    case p3:
      return "&gt;";
    case p4:
      return "&quot;";
    case p5:
      return "&apos;";
  }
});
console.log(result)
return result;
}

convertHTML("Dolce & Gabbana");
convertHTML("<>")
convertHTML("abc")

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0.

Challenge: Convert HTML Entities

Link to the challenge: