Examples of groupCount()


Examples of java.util.regex.Matcher.groupCount()

      {
        Matcher logsearch_matcher = HELP_PATTERN.matcher(arguments.toLowerCase());
       
        // check if the syntax is correct
        if (!logsearch_matcher.matches() ||
          (logsearch_matcher.groupCount() < 1 &&
           logsearch_matcher.groupCount() > 2))
        {
          bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'."));
          return;
        }
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

        Matcher logsearch_matcher = HELP_PATTERN.matcher(arguments.toLowerCase());
       
        // check if the syntax is correct
        if (!logsearch_matcher.matches() ||
          (logsearch_matcher.groupCount() < 1 &&
           logsearch_matcher.groupCount() > 2))
        {
          bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'."));
          return;
        }
       
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

       
        // get the different help arguments
        String module_name = null;
        String help_key = null;
        module_name = logsearch_matcher.group(1);
        if (logsearch_matcher.groupCount() > 1)
        {
          help_key = logsearch_matcher.group(2);
          if (0 == help_key.length())
          {
            help_key = null;
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

      synchronized (sb)
      {
        do
        {
          actual_url = url_matcher.group(1);
          if (url_matcher.groupCount() > 1)
          {
            visual_url = url_matcher.group(2);
          }
          else
          {
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

    private ParsedModuleStringNotation splitDescriptionIntoModuleNotationAndArtifactType(String notation) {
        Matcher matcher = EXTENSION_SPLITTER.matcher(notation);
        boolean hasArtifactType = matcher.matches();
        if (hasArtifactType) {
            if (matcher.groupCount() != 2) {
                throw new InvalidUserDataException("The description " + notation + " is invalid");
            }
            return new ParsedModuleStringNotation(matcher.group(1), matcher.group(2));
        }
        return new ParsedModuleStringNotation(notation, null);
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

      }
    }
    int width = Integer.parseInt( m.group( 1 ) );
    int height = Integer.parseInt( m.group( 2 ) );
    int xpos, ypos;
    if( m.groupCount() > 3 )
    {
      xpos = Integer.parseInt( m.group( 3 ) );
      ypos = Integer.parseInt( m.group( 4 ) );
    }
    else
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

    // are there references to a message and optional to an attachment in the message
    if (urlName.getFile() != null) {
      try {
        Matcher matcher = messagePattern.matcher(url);
        matcher.find();
        if (matcher.groupCount() > 0) {
          if (matcher.group(1).startsWith("message")) {
            result = true;
          }
        }
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

  public static String cutMessageIdentifier(String url) throws Exception {

    String result = "";
    Matcher matcher = messagePattern.matcher(url);
    matcher.find();
    if (matcher.groupCount() > 0) {
      // the first group is the whole message identifier
      result = url.replaceFirst("/" + matcher.group(1), "");
    //System.out.println(matcher.group(1) + " " + matcher.group(2));
    }
    return result;
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

    Matcher m = p.matcher("fred/the/eta_211/");
    //boolean b = m.matches();
    if ( m.matches())
    {
      System.out.println( "Matches" );
      System.out.println( "numGroups : " + m.groupCount());
      for ( int i = 0; i <= m.groupCount(); i++)
      {
        System.out.println( "Group[" + i + "]: " + m.group( i) );
      }
    }
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

    //boolean b = m.matches();
    if ( m.matches())
    {
      System.out.println( "Matches" );
      System.out.println( "numGroups : " + m.groupCount());
      for ( int i = 0; i <= m.groupCount(); i++)
      {
        System.out.println( "Group[" + i + "]: " + m.group( i) );
      }
    }
    else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.