private void parseUrl() {
        /*
        Extract from the JDBC connection URL:
         * The database type (e.g. mysql, postgresql, ...)
         * The docker tag, if provided.
         * The URL query string, if provided
       */
        Matcher urlMatcher = Patterns.URL_MATCHING_PATTERN.matcher(this.getUrl());
        if (!urlMatcher.matches()) {
            //Try for Oracle pattern
            urlMatcher = Patterns.ORACLE_URL_MATCHING_PATTERN.matcher(this.getUrl());
            if (!urlMatcher.matches()) {
                throw new IllegalArgumentException(
                    "JDBC URL matches jdbc:tc: prefix but the database or tag name could not be identified"
                );
            }
        }
        databaseType = urlMatcher.group("databaseType");

        imageTag = Optional.ofNullable(urlMatcher.group("imageTag"));

        //String like hostname:port/database name, which may vary based on target database.
        //Clients can further parse it as needed.
        dbHostString = urlMatcher.group("dbHostString");

        //In case it matches to the default pattern
        Matcher dbInstanceMatcher = Patterns.DB_INSTANCE_MATCHING_PATTERN.matcher(dbHostString);
        if (dbInstanceMatcher.matches()) {
            databaseHost = Optional.of(dbInstanceMatcher.group("databaseHost"));
            databasePort = Optional.ofNullable(dbInstanceMatcher.group("databasePort")).map(Integer::valueOf);
            databaseName = Optional.of(dbInstanceMatcher.group("databaseName"));
        }

        queryParameters =
            Collections.unmodifiableMap(
                parseQueryParameters(Optional.ofNullable(urlMatcher.group("queryParameters")).orElse(""))
            );

        String query = queryParameters
            .entrySet()
            .stream()
            .map(e -> e.getKey() + "=" + e.getValue())
            .collect(Collectors.joining("&"));

        if (query.trim().length() == 0) {
            queryString = Optional.empty();
        } else {
            queryString = Optional.of("?" + query);
        }

        containerParameters = Collections.unmodifiableMap(parseContainerParameters());

        tmpfsOptions = parseTmpfsOptions(containerParameters);

        initScriptPath = Optional.ofNullable(containerParameters.get("TC_INITSCRIPT"));

        reusable = Boolean.parseBoolean(containerParameters.get("TC_REUSABLE"));

        Matcher funcMatcher = Patterns.INITFUNCTION_MATCHING_PATTERN.matcher(this.getUrl());
        if (funcMatcher.matches()) {
            initFunction = Optional.of(new InitFunctionDef(funcMatcher.group(2), funcMatcher.group(4)));
        }

        Matcher daemonMatcher = Patterns.DAEMON_MATCHING_PATTERN.matcher(this.getUrl());
        inDaemonMode = daemonMatcher.matches() && Boolean.parseBoolean(daemonMatcher.group(2));
    }
This method applies various REGEX Patterns to parse the URL associated with this instance.
This is called from a @{@link ConnectionUrl#newInstance(String)} static factory method to create immutable instance of
{@link ConnectionUrl}.
To avoid mutation after class is instantiated, this method should not be publicly accessible.
modules/jdbc/src/main/java/org/testcontainers/jdbc/ConnectionUrl.java