JSFiddle - React, Tailwind, and code Playground

JavaScript

$(function() {

    content = 'hallo mein name ist peter und ich komme aus berlin. Und du?';
    
    words = 'mein na,berlin'
     
    words = words.replace(/,/,'\|');
    words = words.replace(/\s/,'\\s');
    
    regex = new RegExp(words,'gi');

    content = content.replace(regex,'<strong>*insert here the word that was found*</strong>');

    alert(''+content+'');
    
});