code: static ElementAttributes createElementAttributes(String tag) {
          // Parsing strings
          // <!--$includetemplate$aggregated2$templatewithparams.jsp$-->
          // or
          // <!--$includeblock$aggregated2$$(block)$myblock$-->
          // in order to retrieve driver, page and name attributes
          Pattern pattern = Pattern.compile("(?<=\\$)(?:[^\\$]|\\$\\()*(?=\\$)");
          Matcher matcher = pattern.matcher(tag);
          List<String> listparameters = new ArrayList<>();
          while (matcher.find()) {
              listparameters.add(matcher.group());
          }
  
          String[] parameters = listparameters.toArray(new String[listparameters.size()]);
  
          Driver driver;
          String page = "";
          String name = null;
  
          if (parameters.length > 1) {
              driver = DriverFactory.getInstance(parameters[1]);
          } else {
              driver = DriverFactory.getInstance();
          }
  
          if (parameters.length > 2) {
              page = parameters[2];
          }
  
          if (parameters.length > 3) {
              name = parameters[3];
          }
          return new ElementAttributes(driver, page, name);
  
      }
docs: Parse the tag and return the ElementAttributes
  
  @param tag
  the tag to parse
  @return ElementAttributes