title: JS: Regular expression SyntaxError: Invalid regular expression: invalid group specifier name
body: <p>I know that there are similar questions, but can't get it over there.
  I have such regex: </p>
  
  <pre><code>const pattern = new RegExp(
        `(?&lt;=(.)?)\\b.{0,${truncateLength}}${searchExpression}.{0,${truncateLength}}\\b(?=(.)?)`,
        'i'
      );
  </code></pre>
  
  <p>Same for:</p>
  
  <pre><code>   const pattern = new RegExp(
        '(?&lt;=(.)?)\\b.{0,' +
          truncateLength +
          '}' +
          searchExpression +
          '.{0,' +
          truncateLength +
          '}\\b(?=(.)?)',
        'i'
      );
  </code></pre>
  
  <p>Unfortunately, it's not working is safari. How can it be replaced to support all browsers? Thank you!</p>