Examples of group()


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

  public static boolean mkdirs(File f) {
    if (Constants.isOSX) {
      Pattern pat = Pattern.compile("^(/Volumes/[^/]+)");
      Matcher matcher = pat.matcher(f.getParent());
      if (matcher.find()) {
        String sVolume = matcher.group();
        File fVolume = new File(sVolume);
        if (!fVolume.isDirectory()) {
          Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING, sVolume
              + " is not mounted or not available."));
          return false;
View Full Code Here

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

      // magnet:?xt=urn:btih:WENBTYBB7676MQWJ7NLTD4NGYDKYSQPO&dn=[DmzJ][School_Days][Vol.01-06][DVDRip]
      for (String toMatch : titles) {
        Matcher matcher = Pattern.compile("[?&]" + toMatch + "=(.*)&?",
            Pattern.CASE_INSENSITIVE).matcher(url);
        if (matcher.find()) {
          return matcher.group(1);
        }
      }
     
      /*
       * If no 'title' field was found then just get the file name instead
View Full Code Here

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

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

      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

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

        // 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

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

        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

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

    //       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

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

    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

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

  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

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

            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
TOP
Copyright © 2015 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.