Package java.util.regex

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


        Matcher matcher = null;
        for (String appPath : unfilteredAppPaths) {
            if (matcher == null) {
                matcher = filter.matcher(appPath);
            } else {
                matcher.reset(appPath);
            }
            if (matcher.matches()) {
                if (log.isDebugEnabled()) {
                    log.debug(sm.getString("hostConfig.ignorePath", appPath));
                }
View Full Code Here


                ++lineCount;
                if(capped) {
                    continue;
                }
                CharSequence line = cb.subSequence(lines.start(), lines.end());
                target.reset(line);
                if(target.find()) {
                    if(host != null && !host.equals(target.group(GROUP_HOST))) {
                        continue;
                    }
                    if(user != null && !user.equals(target.group(GROUP_USER))) {
View Full Code Here

      // Replace the original with the new character
      sb.replace(matcher.start(), matcher.end(), String.valueOf(a));

      // Start again, since our positions have switched
      matcher.reset();
    }
    return sb.toString();
  }

  /**
 
View Full Code Here

            lines++;
            CharSequence cs = lm.group(); // The current line
            if (pm == null)
                pm = pattern.matcher(cs);
            else
                pm.reset(cs);
            if (pm.find())
                matches.add(pm.group());
            if (lm.end() == cb.limit())
                break;
        }
View Full Code Here

                        continue;
                    }
                   
                    // remove G1 ergonomics pieces
                    if (line.indexOf(G1_ERGONOMICS) >= 0) {
                        ergonomicsMatcher.reset(line);
                        if (ergonomicsMatcher.matches()) {
                            String firstMatch = (ergonomicsMatcher.group(1));
                            if (firstMatch.length() > 0 && line.indexOf(SOFT_REFERENCE) < 0) {
                                beginningOfLine = firstMatch;
                            }
View Full Code Here

            }
            else if (line.indexOf(INCOMPLETE_CONCURRENT_EVENT_INDICATOR) >= 0) {
                parseIncompleteConcurrentEvent(model, event, line, pos);
            }
            else {
                memoryMatcher.reset(line);
                if (memoryMatcher.matches()) {
                    // it is java 1.7_u1 or earlier (including java 1.6)
                    // memory part looks like
                    //    [ 8192K->8128K(64M)]
                    setMemoryExtended(event, line, pos);
View Full Code Here

                        }
                        beginningOfLine.addFirst(currentBeginning + line.substring(0, line.indexOf(PRINT_CMS_STATISTICS_SURVIVOR)));
                        continue;
                    }
                    if (line.indexOf(PRINT_TENURING_DISTRIBUTION) > 0) {
                        printTenuringDistributionMatcher.reset(line);
                        if (!printTenuringDistributionMatcher.matches()) {
                            LOG.severe("printDistributionMatcher did not match for line " + lineNumber + ": '" + line + "'");
                            continue;
                        }
                       
View Full Code Here

                }

                if (inExternalPage) {
                    if (epeMatcher.reset(curLine).matches()) {
                        inExternalPage = false;
                    } else if (topicMatcher.reset(curLine).matches()) {
                        try {
                            URL url = new URL(URLDecoder.decode(urlString, "UTF-8"));
                            String hostname = url.getHost();
                            boolean isAdult = topicMatcher.group(1).startsWith("Top/Adult");
                           
View Full Code Here

                }

                urlString = null;
                if (aboutMatcher.reset(curLine).matches()) {
                    urlString = aboutMatcher.group(1);
                } else if (resourceMatcher.reset(curLine).matches()) {
                    urlString = resourceMatcher.group(1);
                }

                if (urlString != null) {
                    numUrls += 1;
View Full Code Here

                    System.out.print('.');
                }

                boolean checkForTopic = !inGoodTopic;
                if (inGoodTopic) {
                    if (resourceMatcher.reset(curLine).matches()) {
                        urlString = resourceMatcher.group(2);
                        numUrls += 1;

                        try {
                            URL url = new URL(URLDecoder.decode(urlString, "UTF-8"));
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.