Package java.util.regex

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


        return;
      }
     
      Matcher register_matcher = REGISTER_PATTERN.matcher(arguments);
     
      if (!register_matcher.matches() ||
        register_matcher.groupCount() != 2)
      {
        bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'"));
        return;
      }
View Full Code Here


      s = s.trim();
      if ("".equals(s))
        continue;
      child = current.getRouteChild(s);
      Matcher matcher = paramPattern.matcher(s);
      if (matcher.matches()) {// 处理参数类型的路由节点
        child = new ServiceRoute(matcher.group(1));
        current.addParamChild(PARAM_KEY, child);
      } else {// 处理变通类型的路由节点(只有最末端的节点才会绑定到服务)
        if (child == null)
          child = new ServiceRoute();
View Full Code Here

        arguments.trim().length() > 0)
      {
        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

        Matcher m;

        /* if it's already OSGi compliant don't touch it */
        m = OSGI_VERSION_PATTERN.matcher(version);
        if (m.matches()) {
            return version;
        }

        osgiVersion = version;

View Full Code Here

        osgiVersion = version;

        /* check for dated snapshot versions with only major or major and minor */
        m = DATED_SNAPSHOT.matcher(osgiVersion);
        if (m.matches()) {
            String major = m.group(1);
            String minor = (m.group(3) != null) ? m.group(3) : "0";
            String service = (m.group(5) != null) ? m.group(5) : "0";
            String qualifier = m.group(6).replaceAll("-", "_").replaceAll("\\.", "_");
            osgiVersion = major + "." + minor + "." + service + "." + qualifier;
View Full Code Here

        /* else transform first - to . and others to _ */
        osgiVersion = osgiVersion.replaceFirst("-", "\\.");
        osgiVersion = osgiVersion.replaceAll("-", "_");
        m = OSGI_VERSION_PATTERN.matcher(osgiVersion);
        if (m.matches()) {
            return osgiVersion;
        }

        /* remove dots in the middle of the qualifier */
        m = DOTS_IN_QUALIFIER.matcher(osgiVersion);
View Full Code Here

            return osgiVersion;
        }

        /* remove dots in the middle of the qualifier */
        m = DOTS_IN_QUALIFIER.matcher(osgiVersion);
        if (m.matches()) {
            String s1 = m.group(1);
            String s2 = m.group(2);
            String s3 = m.group(3);
            String s4 = m.group(4);

View Full Code Here

            Matcher qualifierMatcher = ONLY_NUMBERS.matcher(s3);
            /*
             * if last portion before dot is only numbers then it's not in the middle of the
             * qualifier
             */
            if (!qualifierMatcher.matches()) {
                osgiVersion = s1 + s2 + "." + s3 + "_" + s4;
            }
        }

        /* convert
 
View Full Code Here

            if (qualifier == null) {
                osgiVersion = getVersion(major, minor, service, qualifier);
            } else {
                /* if last portion is only numbers then it's not a qualifier */
                Matcher qualifierMatcher = ONLY_NUMBERS.matcher(qualifier);
                if (qualifierMatcher.matches()) {
                    if (minor == null) {
                        minor = qualifier;
                    } else {
                        service = qualifier;
                    }
View Full Code Here

        return moduleDependency;
    }

    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));
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.