Examples of groupCount()


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

        if (m.lookingAt()) {
          int p = position; // TODO p wegrefactorn
          String match = m.group(); // korrekt?
          if (pattern.isIgnoreLastGroup()) {
            assert m.groupCount() > 0;
            String g = m.group(m.groupCount());
            assert g != null;
            assert match.endsWith(g);
            match = match.substring(0, match.length() - g.length());
          }
          position += match.length();
View Full Code Here

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

      String inputString = FileUtils.load(bis, "utf-8");
      // Remove all HTML Tags
      Matcher m = HREF_PATTERN.matcher(inputString);
      String match;
      while (m.find()) {
        int groupCount = m.groupCount();
        if (groupCount > 0) {
          match = m.group(1); // e.g. 'seite2.html'
          if (!match.startsWith("http://")) { // TODO: Filter other url than http
            linkList.add(match);
          }
View Full Code Here

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

  public String[] transform(InputRow inputRow) {
    final Matcher matcher = pattern.matcher("");
    final String value = inputRow.getValue(column);
    final boolean match = value != null && matcher.reset(value).matches();

    String[] result = new String[matcher.groupCount() + 1];
    for (int i = 0; i < result.length; i++) {
      result[i] = match ? matcher.group(i) : null;
    }
    return result;
  }
View Full Code Here

Examples of jregex.Matcher.groupCount()

            if (matcher.find()) {
                Long idBrowser = entry.getValue();
                BrowserEntry be = browserMap.get(idBrowser);
                if (be != null) {
                    retObj.setType(browserTypeMap.get(be.getType()));;
                    if (matcher.groupCount() > 1) {
                        retObj.setBrowserVersionInfo(matcher.group(1));
                    }
                    retObj.setBrowserEntry(be);
                }
                // check if this browser has exactly one OS mapped
View Full Code Here

Examples of org.jregex.MatchResult.groupCount()

                            index = ix;
                        }
                    }
                    MatchResult mr = getMatchResult(on);
                    if(index < mr.groupCount() && mr.isCaptured(index)) {
                        return context.runtime.newNumber(mr.start(index));
                    } else {
                        return context.runtime.newNumber(-1);
                    }
                }
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.