public BrowserLauncher getBrowserLauncher(String browser, String sessionId, RemoteControlConfiguration configuration, BrowserConfigurationOptions browserOptions) {
        if (browser == null) {
            throw new IllegalArgumentException("browser may not be null");
        }
        String executablePath = null;
        if (browserOptions.hasOptions()) {
            executablePath = browserOptions.getExecutablePath();
        } else {
            configuration.copySettingsIntoBrowserOptions(browserOptions);
        }

        for (String key : supportedBrowsers.keySet()) {
            final BrowserStringParser.Result result;
            result = new BrowserStringParser().parseBrowserStartCommand(key, browser);
            if (result.match()) {
                if (executablePath == null) {
                    executablePath = result.customLauncher();
                    browserOptions.setExecutablePath(executablePath);
                }
                LOGGER.debug("Requested browser string '" + browser + "' matches *" + key + " ");
                return createBrowserLauncher(supportedBrowsers.get(key), executablePath, sessionId, configuration, browserOptions);
            }
        }

        LOGGER.debug("Requested browser string '" + browser + "' does not match any known browser, treating it as a custom browser...");
        Matcher CustomMatcher = CUSTOM_PATTERN.matcher(browser);
        if (CustomMatcher.find()) {
            String browserStartCommand = CustomMatcher.group(1);
            if (browserStartCommand == null) {
                throw new RuntimeException("You must specify the path to an executable when using *custom!\n\n");
            }
            browserStartCommand = browserStartCommand.substring(1);
            return new CustomBrowserLauncher(browserStartCommand, sessionId, configuration, browserOptions);
        }
        throw browserNotSupported(browser);
    }