match function not accept string regex code example Example: js string to regex const regex = new RegExp('https:\\/\\/\\w*\\.\\w*.*', 'g');