code: public String getTrxIDFromSubject(String strSubject)
      {
          String strTrxID = null;
          if (strSubject != null)
          {
              int iLastParen = strSubject.lastIndexOf(')');
              int iStartParen = strSubject.lastIndexOf('(');
              if (iLastParen != -1)
                  if (iStartParen != -1)
                      if (iLastParen > iStartParen)
                      {
                          strTrxID = strSubject.substring(iStartParen + 1, iLastParen);
                          if (!Utility.isNumeric(strTrxID))
                              strTrxID = null;    // Must be numeric
                      }
          }
          return strTrxID;
      }
docs: Utility to extract the trx ID from the subject line.
  Re: Subject (123)