Package java.util.regex

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


    public SortedSet list() {
        SortedSet artifacts = new TreeSet();
        String[] names = getFiles(rootFile, "");
        Matcher matcher = MAVEN_1_PATTERN.matcher("");
        for (int i = 0; i < names.length; i++) {
            matcher.reset(names[i]);
            if (matcher.matches()) {
                String groupId = matcher.group(1);
                String artifactId = matcher.group(3);
                String version = matcher.group(4);
                String type = matcher.group(2);
View Full Code Here


                }
                CharSequence line = cb.subSequence(lines.start(), lines.end());
                target.reset(line);
                if(target.find()) {
                    if(text != null) {
                        text.reset(line);
                        if(!text.find()) {
                            hit = false;
                            continue;
                        }
                    }
View Full Code Here

                            ++fileCount;
                            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

                if(stop != null && stop.intValue() < lineCount) {
                    continue;
                }
                CharSequence line = cb.subSequence(lines.start(), lines.end());
                if(text != null) {
                    text.reset(line);
                    if(!text.find()) {
                        continue;
                    }
                }
                list.add(new LogMessage(lineCount,line.toString()));
View Full Code Here

            Matcher matcher = Pattern.compile("\\$\\{([^}]+)\\}").matcher(prompt);
            while (matcher.find()) {
                Object rep = session.get(matcher.group(1));
                if (rep != null) {
                    prompt = prompt.replace(matcher.group(0), rep.toString());
                    matcher.reset(prompt);
                }
            }
            return prompt;
        } catch (Throwable t) {
            return "$ ";
View Full Code Here

      return null;
    }
    Matcher match = varPat.matcher("");
    String eval = expr;
    for(int s=0; s<MAX_SUBST; s++) {
      match.reset(eval);
      if (!match.find()) {
        return eval;
      }
      String var = match.group();
      var = var.substring(2, var.length()-1); // remove ${ .. }
View Full Code Here

                }
                if(stop != null && stop.intValue() < lineCount) {
                    continue;
                }
                if(text != null) {
                    text.reset(line);
                    if(!text.find()) {
                        continue;
                    }
                }
                list.add(new LogMessage(lineCount,line.toString()));
View Full Code Here

                LOG.trace("Replacing: {} with header value: {}", matcher.group(0), header);
            }

            uri = matcher.replaceFirst(header);
            // we replaced uri so reset and go again
            matcher.reset(uri);
        }

        String query = exchange.getIn().getHeader(Exchange.HTTP_QUERY, String.class);
        if (query != null) {
            LOG.trace("Adding query: {} to uri: {}", query, uri);
View Full Code Here

        }
    }

    public Artifact installLibrary(File libFile, String groupId) throws IOException {
        Matcher matcher = MAVEN_1_PATTERN_PART.matcher("");
        matcher.reset(libFile.getName());
        if (matcher.matches()) {
            String artifactId = matcher.group(1);
            String version = matcher.group(2);
            String type = matcher.group(3);
            Artifact artifact = new Artifact(groupId != null ? groupId : Artifact.DEFAULT_GROUP_ID, artifactId, version, type);
View Full Code Here

                    continue;
                }
                target.reset(line);
                if(target.find()) {
                    if(text != null) {
                        text.reset(line);
                        if(!text.find()) {
                            hit = false;
                            continue;
                        }
                    }
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.