stoty commented on code in PR #2107:
URL: https://github.com/apache/phoenix/pull/2107#discussion_r2037064180


##########
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java:
##########
@@ -119,6 +125,20 @@ protected static String unescape(String escaped) {
         return escaped.replaceAll("\\\\:", "=");
     }
 
+    protected static String escapeIPv6Literal(String unescaped){
+        String regex = "(\\[.*?\\])";
+        Pattern pattern = Pattern.compile(regex);
+        Matcher matcher = pattern.matcher(unescaped);
+        StringBuffer result = new StringBuffer();
+        while (matcher.find()) {
+            String matchedText = matcher.group(1);
+            String modifiedText = matchedText.replace(":", "\\\\:");
+            matcher.appendReplacement(result, modifiedText);

Review Comment:
   I didn't know this construct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to