return of the RegExp in java script code example Example: js string to regex const regex = new RegExp('https:\\/\\/\\w*\\.\\w*.*', 'g');