code: public final static int escape(final StringBuilder out, final char ch, final int pos)
      {
          switch (ch)
          {
          case '\\':
          case '[':
          case ']':
          case '(':
          case ')':
          case '{':
          case '}':
          case '#':
          case '"':
          case '\'':
          case '.':
          case '>':
          case '<':
          case '*':
          case '+':
          case '-':
          case '_':
          case '!':
          case '`':
          case '^':
              out.append(ch);
              return pos + 1;
          default:
              out.append('\\');
              return pos;
          }
      }
docs: Processed the given escape sequence.
  
  @param out
  The StringBuilder to write to.
  @param ch
  The character.
  @param pos
  Current parsing position.
  @return The new position.