code: public boolean startsWith(CharSequence text)
      {
          try
          {
              if (text.length() == 0)
              {
                  if (acceptEmpty)
                  {
                      return true;
                  }
                  else
                  {
                      throw new SyntaxErrorException("empty string not accepted");
                  }
              }
              InputReader reader = Input.getInstance(text);
              return startsWith(reader);
          }
          catch (IOException ex)
          {
              throw new IllegalArgumentException("can't happen");
          }
      }
docs: Returns true if input start matches the regular expression
  @param text
  @return