code: def __substituteFromClientStatement(self,match,prevResponse,extraSymbol="",sessionID = "general"):
          
          prev = 0
          startPadding = 1+len(extraSymbol)
          finalResponse = ""
          for m in re.finditer(r'%'+extraSymbol+'[0-9]+', prevResponse):
              start = m.start(0)
              end = m.end(0)     
              num = int(prevResponse[start+startPadding:end])
              finalResponse += prevResponse[prev:start]
              try:finalResponse += self._quote(self._substitute(match.group(num)),sessionID)
              except IndexError as e:pass
              prev = end
          namedGroup = match.groupdict()
          if namedGroup:
              prevResponse = finalResponse + prevResponse[prev:]
              finalResponse = ""
              prev = 0
              for m in re.finditer(r'%'+extraSymbol+'([a-zA-Z_][a-zA-Z_0-9]*)([^a-zA-Z_0-9]|$)', prevResponse):
                  start = m.start(1)
                  end = m.end(1)
                  finalResponse += prevResponse[prev:start]
                  try:
                      value = namedGroup[prevResponse[start+startPadding:end]]
                      if value:finalResponse += self._quote(self._substitute(value),sessionID)
                  except KeyError as e:pass
                  prev = end
          return finalResponse + prevResponse[prev:]
docs: Substitute from Client statement into respose