package org.utplsql.cli;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ConnectionConfig {

    private final String user;
    private final String password;
    private final String connect;

    public ConnectionConfig( String connectString ) {
        Matcher m = Pattern.compile("^([^/]+)/([^@]+)@(.*)$").matcher(connectString);
        if ( m.find() ) {
            user = m.group(1);
            password = m.group(2);
            connect = m.group(3);
        }
        else
            throw new IllegalArgumentException("Not a valid connectString: '" + connectString + "'");
    }

    public String getConnect() {
        return connect;
    }

    public String getUser() {
        return user;
    }

    public String getPassword() {
        return password;
    }

    public String getConnectString() {
        return user + "/" + password + "@" + connect;
    }
}

@@ -315,16 +315,23 @@
 (%22%5E(
+%5C%22.+%5C%22%7C
 %5B%5E/%5D+)/(
 %5B%5E@%5D
@@ -326,16 +326,23 @@
 %5B%5E/%5D+)/(
+%5C%22.+%5C%22%7C
 %5B%5E@%5D+)@(
@@ -417,16 +417,37 @@
  user = 
+stripEnclosingQuotes(
 m.group(
@@ -448,16 +448,17 @@
 group(1)
+)
 ;%0A      
@@ -474,16 +474,37 @@
 sword = 
+stripEnclosingQuotes(
 m.group(
@@ -505,16 +505,17 @@
 group(2)
+)
 ;%0A      
@@ -666,32 +666,324 @@
  + %22'%22);%0A    %7D%0A%0A
+    private String stripEnclosingQuotes( String value ) %7B%0A        if ( value.length() %3E 1%0A                && value.startsWith(%22%5C%22%22)%0A                && value.endsWith(%22%5C%22%22)) %7B%0A            return value.substring(1, value.length()-1);%0A        %7D else %7B%0A            return value;%0A        %7D%0A    %7D%0A%0A
     public Strin

Support user/password containing / and @