Package java.util.regex

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


        final Matcher matcher = Pattern.compile(regex, Pattern.DOTALL).matcher(string);
        boolean matched = matcher.find();

        // Get the first matched group.
        Map<String,Object> match = Maps.newHashMap();
        if (matcher.groupCount() > 0) {
            match.put("match", matcher.group(1));
            match.put("start", matcher.start(1));
            match.put("end", matcher.end(1));
        }
View Full Code Here


    @Override
    protected Result run(String value) {
        final Matcher matcher = pattern.matcher(value);

        if (!matcher.find() || matcher.groupCount() == 0 || matcher.start(1) == -1 || matcher.end(1) == -1) {
            return null;
        }

        return new Result(value.substring(matcher.start(1), matcher.end(1)), matcher.start(1), matcher.end(1));
    }
View Full Code Here

  Pattern status1Pattern = Pattern.compile("<body>([^-<]*)-([^-<]*)-([^-<]*)-([^-<]*)-([^-<]*)-([^-<]*)-([^-<]*)-([^-<]*)[|-]?([^-<]*)[|-]?([^-<]*)[|-]?([^-<]*)[|-]?([^-<]*)[|-]?([^<]*)</body>", Pattern.CASE_INSENSITIVE);
  Matcher status1Matcher = status1Pattern.matcher(sFBFWV_IN);

  if (status1Matcher.find(0) == true) {

   String[] S10 = new String[status1Matcher.groupCount() + 1];

   if (status1Matcher.groupCount() >= 9) {

    for (int i = 0; i <= status1Matcher.groupCount(); i++) {
     S10[i] = status1Matcher.group(i);
View Full Code Here

  if (status1Matcher.find(0) == true) {

   String[] S10 = new String[status1Matcher.groupCount() + 1];

   if (status1Matcher.groupCount() >= 9) {

    for (int i = 0; i <= status1Matcher.groupCount(); i++) {
     S10[i] = status1Matcher.group(i);
     //System.out.println( S10[i]);
    }
View Full Code Here

   String[] S10 = new String[status1Matcher.groupCount() + 1];

   if (status1Matcher.groupCount() >= 9) {

    for (int i = 0; i <= status1Matcher.groupCount(); i++) {
     S10[i] = status1Matcher.group(i);
     //System.out.println( S10[i]);
    }

    if (S10[8].length() >= 5) {
View Full Code Here

     sFBFWV81 = S10[8].substring(0, S10[8].length() - 4);
     sFBFWV82 = S10[8].substring(S10[8].length() - 4, S10[8].length() - 2);
     sFBFWV83 = S10[8].substring(S10[8].length() - 2, S10[8].length());
     // sFBFWV90 = S10[9];

     if (status1Matcher.groupCount() >= 9) {
      sFBFWV90 = S10[9];
     }
     if (status1Matcher.groupCount() >= 10) {
      sFBFWV100 = S10[10];
     }
View Full Code Here

     // sFBFWV90 = S10[9];

     if (status1Matcher.groupCount() >= 9) {
      sFBFWV90 = S10[9];
     }
     if (status1Matcher.groupCount() >= 10) {
      sFBFWV100 = S10[10];
     }
     if (status1Matcher.groupCount() >= 11) {
      sFBFWV110 = S10[11];
      if (!"".equals(S10[11]) && S10[11].length() == 2) {
View Full Code Here

      sFBFWV90 = S10[9];
     }
     if (status1Matcher.groupCount() >= 10) {
      sFBFWV100 = S10[10];
     }
     if (status1Matcher.groupCount() >= 11) {
      sFBFWV110 = S10[11];
      if (!"".equals(S10[11]) && S10[11].length() == 2) {
       isFritzboxLanguageOK = true;
      }
     }
View Full Code Here

    @Override
    protected String extractId(@NotNull String match) {
        Matcher matcher = myPattern.matcher(match);
        matcher.find();
        if (matcher.groupCount() >= 1) {
            return matcher.group(1);
        } else {
            return super.extractId(match);
        }
    }
View Full Code Here

  public List<String> getMessageArgs(final String msg) {
    Pattern _pattern = this.getPattern();
    final Matcher matcher = _pattern.matcher(msg);
    boolean _matches = matcher.matches();
    if (_matches) {
      final int num = matcher.groupCount();
      final ArrayList<String> result = CollectionLiterals.<String>newArrayList();
      int i = 1;
      while ((i <= num)) {
        {
          String _group = matcher.group(i);
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.