Regex variables

Ignore the regex code
I want to do take regex code in another variable and want to use it like i have used below(this one is not working). please help
let reRegex =/^[[1(\d\d\d)\d\d\d-\d\d\d\d]|[1\s\d\d\d-\d\d\d-\d\d\d\d]]|[(\d\d\d)\d\d\d-\d\d\d\d]|[\d\d\d-\d\d\d-\d\d\d\d]]/;
let regex = /reRegex/;
let result = regex.test(str);

Use RegExp contructor:

let regex = new RegExp(reRegex);