RegExp symbols for variables and substitution

About https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations

Hello camp!

In the fourth solution, the symbol (`) was used. I made my own decision and tried to start with RegExp, but I could not remember how to make a search set using a variable. I spent the whole day searching, but I only came across the use of pure variables / strings, without square brackets around.
When I looked at the 4th solution, it seemed to me that somewhere in the RegExp lessons I had already seen such a syntax, but even then I could not find this lesson, if it exists, I would be glad to have a link or a link to another source explaining this syntax.

Also, I couldn’t find a lesson where () were used in a literal RegExp, it seems to me that this was also related to substitution, I would be grateful for the link.

Also surprised by the possibility of using square brackets with a variable in this post:

https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-mutations/16025/18?u=gekasam94

As far as I understand, this syntax is interpreted as a Symbol Class designation, if so, I would like to know what other syntaxes can be used in a similar implementation (“,” + var + “…”, flags).

Thank you for attention!