JSFiddle - React, Tailwind, and code Playground
JavaScript
let str = "3 HTML tags are: <html>, <a href src='www.google.com'>, and <body>.";
let map = {
"<html>":"<HTML>",
"<a*>":"<A HREF SRC='..'",
"<body>":"<BODY>"
};
str = str.replace(/<html>|<a*>|<body>/gi, function(matched){
return map[matched];
});
alert(str);