Package java.util.regex

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


          NOTE: This text fitting algorithm returns everytime it finds a line break character,
          as it's intended to evaluate the width of just a single line of text at a time.
        */
        for(
          int spaceIndex = matcher.start(1),
            spaceEnd = matcher.end(1);
          spaceIndex < spaceEnd;
          spaceIndex++
          )
        {
          switch(text.charAt(spaceIndex))
View Full Code Here


              break fitting;
          }
        }

        // Get the limit of the current word!
        int wordEndIndex = matcher.end(0);
        // Add the current word!
        float wordWidth = font.getKernedWidth(
          matcher.group(0),
          fontSize
          ); // Current word's width.
View Full Code Here

          '#' + Integer.toHexString(
            unescapedMatcher.group(0).charAt(0)
            )
          );

        index = unescapedMatcher.end();
      }
      if(index < stringValue.length())
      {buffer.append(stringValue.substring(index));}
    }
    setRawValue(buffer.toString());
View Full Code Here

          escapedMatcher.group(1),
          16
          )
        );

      index = escapedMatcher.end();
    }
    if(index < value.length())
    {buffer.append(value.substring(index));}

    return buffer.toString();
View Full Code Here

        p.append("(?iu)");
        int seqc = 0;
        while (query.length() > 0) {
            final Matcher m = StringMatchPattern.matcher(query);
            if (!m.matches()) break;
            p.append(".*?").append(query.substring(m.start(1) + 1, m.end(1) - 1));
            query = query.substring(m.end(1));
            seqc++;
        }
        if (seqc == 0) return QueryParams.catchall_pattern;
        p.append(".*");
 
View Full Code Here

        int seqc = 0;
        while (query.length() > 0) {
            final Matcher m = StringMatchPattern.matcher(query);
            if (!m.matches()) break;
            p.append(".*?").append(query.substring(m.start(1) + 1, m.end(1) - 1));
            query = query.substring(m.end(1));
            seqc++;
        }
        if (seqc == 0) return QueryParams.catchall_pattern;
        p.append(".*");
        return Pattern.compile(p.toString());
View Full Code Here

                    throw new RuntimeException(
                            "Undefined value for behavior: " + behavior);
            }
            sb.append(s.substring(previousEnd, matcher.start())
                        + ((varValue == null) ? matcher.group() : varValue));
            previousEnd = matcher.end();
        }
        return (previousEnd < 1) ? s
                                 : (sb.toString() + s.substring(previousEnd));
    }
View Full Code Here

                    throw new RuntimeException(
                            "Undefined value for behavior: " + behavior);
            }
            sb.append(s.substring(previousEnd, matcher.start())
                        + ((varValue == null) ? matcher.group() : varValue));
            previousEnd = matcher.end();
        }
        return (previousEnd < 1) ? s
                                 : (sb.toString() + s.substring(previousEnd));
    }
View Full Code Here

      while (matcher.find()) {
        int start = matcher.start();
        if (start != 0) {
          errorIndexes.add(new Integer(start));
        }
        int end = matcher.end();
        if (end != booleanExpression.length()) {
          errorIndexes.add(new Integer(end));
        }
      }
      if (errorIndexes.isEmpty()) {
View Full Code Here

    if (replacements.length < intGroupCount)
      throw new RuntimeException("replacements missing: " + replacements.length + " replacement(s) defined but " + intGroupCount + " groups found");

    // no groups, exchange the whole string
    if (intGroupCount == 0) {
      result = pstrSourceString.substring(0, m.start()) + replacements[0] + pstrSourceString.substring(m.end());
    }
    else {
      int index = 0;

      for (int i = 1; i <= intGroupCount; 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.