Package java.util.regex

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


  {
    Matcher matcher = rangePattern.matcher(filter);
    List list = new ArrayList();
    if( matcher.matches() )
    {
      int minId = Integer.parseInt(matcher.group(1));
      if( minId == 0 )
        throw new AzureusCoreException("lower range must be greater than 0");
      if( minId > torrents.size() )
        throw new AzureusCoreException("lower range specified (" + minId + ") is outside number of torrents (" + torrents.size() + ")");
      if( matcher.group(2) == null )
View Full Code Here


      int minId = Integer.parseInt(matcher.group(1));
      if( minId == 0 )
        throw new AzureusCoreException("lower range must be greater than 0");
      if( minId > torrents.size() )
        throw new AzureusCoreException("lower range specified (" + minId + ") is outside number of torrents (" + torrents.size() + ")");
      if( matcher.group(2) == null )
      {       
        // received a single number. eg: 3
        list.add(torrents.get(minId-1));
        return list;
      }
View Full Code Here

        // received a single number. eg: 3
        list.add(torrents.get(minId-1));
        return list;
      }
      int maxId;
      if( matcher.group(3) == null )
        // received bound range. eg: 3-5
        maxId = Integer.parseInt(matcher.group(5));
      else
        // received open ended range. eg: 3-
        maxId = torrents.size();
View Full Code Here

        return list;
      }
      int maxId;
      if( matcher.group(3) == null )
        // received bound range. eg: 3-5
        maxId = Integer.parseInt(matcher.group(5));
      else
        // received open ended range. eg: 3-
        maxId = torrents.size();
     
      if( minId > maxId )
View Full Code Here

    //       from the file if we don't have a version yet, thus preventing
    //       the second restart message
    if (version == 0) {
      Matcher matcher = pat.matcher(oldStartupScript);
      if (matcher.find()) {
        String sScriptVersion = matcher.group(1);
        try {
          version = Integer.parseInt(sScriptVersion);
        } catch (Throwable t) {
        }
      }
View Full Code Here

    try {
      String startupScript = FileUtil.readInputStreamAsString(stream, 65535,
          "utf8");
      Matcher matcher = pat.matcher(startupScript);
      if (matcher.find()) {
        String sScriptVersion = matcher.group(1);
        int latestVersion = 0;
        try {
          latestVersion = Integer.parseInt(sScriptVersion);
        } catch (Throwable t) {
        }
View Full Code Here

  public static String expandValue(String value) {
    // Replace {*} with a lookup of *
    if (value != null && value.indexOf('}') > 0) {
      Matcher matcher = PAT_PARAM_ALPHA.matcher(value);
      while (matcher.find()) {
        String key = matcher.group(1);
        try {
          String text = getResourceBundleString(key);
          if (text != null) {
            value = value.replaceAll("\\Q{" + key + "}\\E", text);
          }
View Full Code Here

            Matcher matcher = pattern.matcher(line);
            if (matcher.find()) {
              if (parseMode != 1) {
                parseMode = 1;
              }
              description = matcher.group(1);
              startIp = matcher.group(2);
              endIp = matcher.group(3);
            } else {
              Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
                  "unrecognized line while reading ip filter: " + line));
View Full Code Here

            if (matcher.find()) {
              if (parseMode != 1) {
                parseMode = 1;
              }
              description = matcher.group(1);
              startIp = matcher.group(2);
              endIp = matcher.group(3);
            } else {
              Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
                  "unrecognized line while reading ip filter: " + line));
            }
View Full Code Here

              if (parseMode != 1) {
                parseMode = 1;
              }
              description = matcher.group(1);
              startIp = matcher.group(2);
              endIp = matcher.group(3);
            } else {
              Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
                  "unrecognized line while reading ip filter: " + line));
            }
          }
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.