code: public static List<String> extractURLVars(String input) {
          List<String> list = new ArrayList<String>();
          if (input.startsWith("}"))
              return null;
          int openLoc = input.indexOf('{');
          int closeLoc = 0;
          while (openLoc != -1) {
              closeLoc = input.indexOf('}', closeLoc + 1);
              if (closeLoc <= openLoc)
                  return null; // unmatched closing bracket "xxx}xxx{yy}" or missing closing bracket "xx{xx"
              list.add(input.substring(openLoc + 1, closeLoc));
              openLoc = input.indexOf('{', openLoc + 1);
              if (openLoc > 0 && openLoc < closeLoc)
                  return null; // unmatched opening bracket "xx{yy{zz}"
          }
          closeLoc = input.indexOf('}', closeLoc + 1);
          if (closeLoc != -1)
              return null; // unmatched closing bracket xx{yy}}
          return list;
      }
docs: E.g. a{b}c{d}e returns array: { "b", "d" }