code: int parseLength(Source source, int offset, ProcPatternElement terminator) {
          int length = 0;
  
          // An authority data like john.smith:pa55W0RD@
          int authorityLength = parseAuthority(source, offset + length);
          if (authorityLength <= 0) {
              return -1;
          }
          length += authorityLength;
  
          int hostLength = parseHost(source, offset + length, terminator);
          if (hostLength <= 0) {
              return -1;
          }
          length += hostLength;
  
          // A query like ?key1=value1&key2=value2
          length += parseQuery(source, offset + length, terminator);
  
          return length;
      }
docs: Parse URL. The offset must be on a URL element
  
  @param source     text source
  @param offset     offset for parsing
  @param terminator a terminator element which can be used to cut some URL parts. Can be null.
  @return URL length or -1 if it is not a URL.