Removes matrix parameters from regex_remap plugin (#11571)
diff --git a/doc/admin-guide/plugins/regex_remap.en.rst b/doc/admin-guide/plugins/regex_remap.en.rst
index d5744eb..547309f 100644
--- a/doc/admin-guide/plugins/regex_remap.en.rst
+++ b/doc/admin-guide/plugins/regex_remap.en.rst
@@ -70,7 +70,6 @@
 
     @pparam=[no-]method              [default: off]
     @pparam=[no-]query-string        [default: on]
-    @pparam=[no-]matrix-parameters   [default: off]
     @pparam=[no-]host                [default: off]
 
 If you wish to match on the HTTP method used (e.g. "``GET``\ "),
@@ -92,11 +91,6 @@
 
     ... @pparam=maps.reg @pparam=no-query-string
 
-You can also include the matrix parameters in the string, using
-the option 'matrix-parameters', e.g. ::
-
-    ... @pparam=maps.reg @pparam=matrix-parameters
-
 Finally, to match on the host as well, use the option 'host', e.g. ::
 
     ... @pparam=maps.reg @pparam=host
diff --git a/plugins/regex_remap/regex_remap.cc b/plugins/regex_remap/regex_remap.cc
index 350557b..ca838c2 100644
--- a/plugins/regex_remap/regex_remap.cc
+++ b/plugins/regex_remap/regex_remap.cc
@@ -59,14 +59,14 @@
 
 // Substitutions other than regex matches
 enum ExtraSubstitutions {
-  SUB_HOST       = 11,
-  SUB_FROM_HOST  = 12,
-  SUB_TO_HOST    = 13,
-  SUB_PORT       = 14,
-  SUB_SCHEME     = 15,
-  SUB_PATH       = 16,
-  SUB_QUERY      = 17,
-  SUB_MATRIX     = 18,
+  SUB_HOST      = 11,
+  SUB_FROM_HOST = 12,
+  SUB_TO_HOST   = 13,
+  SUB_PORT      = 14,
+  SUB_SCHEME    = 15,
+  SUB_PATH      = 16,
+  SUB_QUERY     = 17,
+  // 18 is unused, used to be matrix parameters
   SUB_CLIENT_IP  = 19,
   SUB_LOWER_PATH = 20,
 };
@@ -87,24 +87,21 @@
     host   = TSUrlHostGet(bufp, url, &host_len);
     path   = TSUrlPathGet(bufp, url, &path_len);
     query  = TSUrlHttpQueryGet(bufp, url, &query_len);
-    matrix = TSUrlHttpParamsGet(bufp, url, &matrix_len);
     port   = TSUrlPortGet(bufp, url);
 
-    url_len = scheme_len + host_len + path_len + query_len + matrix_len + 32;
+    url_len = scheme_len + host_len + path_len + query_len + 32;
   }
 
   const char *scheme = nullptr;
   const char *host   = nullptr;
   const char *path   = nullptr;
   const char *query  = nullptr;
-  const char *matrix = nullptr;
   int         port   = 0;
 
   int scheme_len = 0;
   int host_len   = 0;
   int path_len   = 0;
   int query_len  = 0;
-  int matrix_len = 0;
 
   int url_len = 0; // Full length, of all components
 };
@@ -442,9 +439,6 @@
         case 'q':
           ix = SUB_QUERY;
           break;
-        case 'm':
-          ix = SUB_MATRIX;
-          break;
         case 'i':
           ix = SUB_CLIENT_IP;
           break;
@@ -515,9 +509,6 @@
       case SUB_QUERY:
         len += req_url->query_len;
         break;
-      case SUB_MATRIX:
-        len += req_url->matrix_len;
-        break;
       case SUB_CLIENT_IP:
         len += INET6_ADDRSTRLEN;
         break;
@@ -583,10 +574,6 @@
           str = req_url->query;
           len = req_url->query_len;
           break;
-        case SUB_MATRIX:
-          str = req_url->matrix;
-          len = req_url->matrix_len;
-          break;
         case SUB_CLIENT_IP:
           str = ats_ip_ntop(TSHttpTxnClientAddrGet(txnp), buff, INET6_ADDRSTRLEN);
           len = strlen(str);
@@ -627,17 +614,16 @@
 struct RemapInstance {
   RemapInstance() : filename("unknown") {}
 
-  RemapRegex *first         = nullptr;
-  RemapRegex *last          = nullptr;
-  bool        pristine_url  = false;
-  bool        profile       = false;
-  bool        method        = false;
-  bool        query_string  = true;
-  bool        matrix_params = false;
-  bool        host          = false;
-  int         hits          = 0;
-  int         misses        = 0;
-  int         failures      = 0;
+  RemapRegex *first        = nullptr;
+  RemapRegex *last         = nullptr;
+  bool        pristine_url = false;
+  bool        profile      = false;
+  bool        method       = false;
+  bool        query_string = true;
+  bool        host         = false;
+  int         hits         = 0;
+  int         misses       = 0;
+  int         failures     = 0;
   std::string filename;
 };
 
@@ -689,10 +675,6 @@
       ri->query_string = true;
     } else if (strncmp(argv[i], "no-query-string", 15) == 0) {
       ri->query_string = false;
-    } else if (strncmp(argv[i], "matrix-parameters", 17) == 0) {
-      ri->matrix_params = true;
-    } else if (strncmp(argv[i], "no-matrix-parameters", 20) == 0) {
-      ri->matrix_params = false;
     } else if (strncmp(argv[i], "host", 4) == 0) {
       ri->host = true;
     } else if (strncmp(argv[i], "no-host", 7) == 0) {
@@ -957,12 +939,6 @@
     match_len += (req_url.path_len);
   }
 
-  if (ri->matrix_params && req_url.matrix && req_url.matrix_len > 0) {
-    *(match_buf + match_len) = ';';
-    memcpy(match_buf + match_len + 1, req_url.matrix, req_url.matrix_len);
-    match_len += (req_url.matrix_len + 1);
-  }
-
   if (ri->query_string && req_url.query && req_url.query_len > 0) {
     *(match_buf + match_len) = '?';
     memcpy(match_buf + match_len + 1, req_url.query, req_url.query_len);