sintaxa noua javascript cu regex

<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
pre{line-height: 2;}

span{
background-color: #eee;
padding: 1px;
outline: 1px solid #999;
}
</style>
</head>
<body>
<pre></pre>
</body>
</html>

<script>
const output =(str, regex, target) => {
target.innerHTML = str.replace(regex,a=`<span>${str}</span>`)

}
var str =`Is this This?`;

var regex = /is/g;

output(str,regex,document.querySelector(‘pre’))
</script>