I need to pass a dynamic variable to the Regexp constructor so that it will dynamically work.
let ccmatch = new RegExp(/(?<=Match to BWSPCLV6X5FERARJLU2UD6WKIA: \b(\w+)\b(\n|\r\n))[\w\W]*?((\n|\r\n)(\n|\r\n))/,'gm');
In the above code I need to make BWSPCLV6X5FERARJLU2UD6WKIA as one dynamic. But its not working If I pass any variable to it.
Can anyone help me please
I tried to make the value in a pattern dynamic but it is not working .