Package java.util.regex

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


      assertTrue(m.find());
      assertEquals(3, m.start());
      assertEquals(6, m.end());
      assertFalse(m.find());

      m.reset("barfoo");
      assertTrue(m.find());
      assertEquals(3, m.start());
      assertEquals(6, m.end());
      assertFalse(m.find());
View Full Code Here


      assertTrue(m.find());
      assertEquals(3, m.start());
      assertEquals(6, m.end());
      assertFalse(m.find());

      m.reset("foobarfoobarfoo");
      assertTrue(m.find());
      assertEquals(0, m.start());
      assertEquals(3, m.end());
      assertTrue(m.find());
      assertEquals(6, m.start());
View Full Code Here

        Matcher matcher = PATTERN.matcher(date);

        if (matcher.matches()) {

            matcher.reset();

            if (matcher.find()) {

                int year = Integer.parseInt(matcher.group(1));
                String month = matcher.group(2);
View Full Code Here

            Pattern pattern = Pattern.compile(namePattern.toString());

            Matcher matcher = pattern.matcher(workflowName);
            if (matcher.matches()) {
                matcher.reset();
                if (matcher.find()) {
                    String tag = matcher.group(1);
                    String suffixes = matcher.group(2);
                    return new Pair<Tag, String>(Tag.valueOf(tag), suffixes);
                }
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

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

                            ++lineCount;
                            ++fileLineCount;
                            if(capped) {
                                continue;
                            }
                            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

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

        }
    }

    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

        }
    }

    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

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.