code: def _get_dim_modifier(self, modifiers, dimstring=None):
          
          if dimstring is None:
              suffix = modifiers.split("dimension")[1]
              start = modifiers.index("dimension") + len("dimension")
          else:
              suffix = dimstring
              start = 0
          
          #We use a stack to monitor how many parenthesis we have traversed in the string.
          #Once we reach the closing parenthesis, we know that we have the dimension info.
          stack = []
          args = []
          for i in range(len(suffix)):
              if suffix[i] == '(':
                  stack.append(i + start)
              elif suffix[i] == ')':
                  args.append((stack.pop(), i + start))
                  if len(stack) == 0:
                      #The last entry in args should be the indices of the entire
                      #dimension expression once the very first '(' has its twin found.
                      return args[-1]
docs: Extracts the dimension information from the string of modifiers extracted by
          the regex.
          
          :arg modifiers: the list of modifiers identified by the regex.