code: public String find(CharSequence text)
      {
          try
          {
              if (text.length() == 0)
              {
                  if (acceptEmpty)
                  {
                      return "";
                  }
                  else
                  {
                      throw new SyntaxErrorException("empty string not accepted");
                  }
              }
              if (acceptEmpty)
              {
                  throw new IllegalArgumentException("using find for expression that accepts empty string");
              }
              InputReader reader = Input.getInstance(text);
              int rc = find(reader);
              if (rc == 1)
              {
                  return reader.getString();
              }
              else
              {
                  throw new SyntaxErrorException("string matching '" + expression + "' not found");
              }
          }
          catch (IOException ex)
          {
              throw new IllegalArgumentException("can't happen", ex);
          }
      }
docs: Finds next match and returns the matched string
  @param text
  @return
  @throws SyntaxErrorException