0

this is my regex:

/^(\d|\d{2,}):node_type$/gm

But I need to parameterizing it with

var myVar = "a value";
var regex = /^(\d|\d{2,}):+myVar+$/gm;

I know this is not possibile in this way and I know that I need to using:

var regex = new RegExp(...);

So my question is how can I use RegExp to parameterizing my regex with myVar?

Fobi
  • 435
  • 1
  • 7
  • 17

0 Answers0