Examples of region()


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

        Performance perf = new Performance("Slow regular expression");
        perf.setThreshold(slowRegexp);
        itSuggestion.remove();
        Matcher matcher = suggestion.initMatcher(contents);
        for (ContentsChunk chunk : chunks) {
          matcher.region(chunk.getBegin(), chunk.getEnd());
          int authorizedBegin = chunk.getBegin();
          while (matcher.find()) {
            int begin = matcher.start();
            int end = matcher.end();
            tmpReplacements.clear();
View Full Code Here

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

        Matcher matcher = suggestion.initMatcher(contents);

        // Check suggestion on every template
        for (PageElementTemplate template : templates) {
          int begin = template.getBeginIndex();
          if (matcher.region(begin, contentsLength).lookingAt()) {
            int end = matcher.end();
            if ((end >= contentsLength) ||
                (!Character.isLetterOrDigit(contents.charAt(end))) ||
                (!Character.isLetterOrDigit(contents.charAt(end - 1)))) {
              result |= addReplacements(
View Full Code Here

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

        }

        // Check suggestion on every function
        for (PageElementFunction function : functions) {
          int begin = function.getBeginIndex();
          if (matcher.region(begin, contentsLength).lookingAt()) {
            int end = matcher.end();
            if ((end >= contentsLength) ||
                (!Character.isLetterOrDigit(contents.charAt(end))) ||
                (!Character.isLetterOrDigit(contents.charAt(end - 1)))) {
              result |= addReplacements(
View Full Code Here

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

        Matcher matcher = suggestion.initMatcher(contents);

        // Check suggestion on every internal links
        for (PageElementInternalLink link : links) {
          int begin = link.getBeginIndex();
          if (matcher.region(begin, contentsLength).lookingAt()) {
            int end = matcher.end();
            if ((end >= contentsLength) ||
                (!Character.isLetterOrDigit(contents.charAt(end))) ||
                (!Character.isLetterOrDigit(contents.charAt(end - 1)))) {
              result |= addReplacements(
View Full Code Here

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

  private void collectQualifiedNames() {
    StringBuffer sb = new StringBuffer(text.length());
    int lastStart = 0;
    Matcher m = QUALIFIED_REFERENCE.matcher(text);
    m.region(lastImportLocation, text.length());
    while (m.find()) {
      sb.append(text.substring(lastStart, m.start(1)));
      lastStart = m.start(2);
      String name = m.group(2);
      String qualifier = trimLastDot(m.group(1));
View Full Code Here

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

             * (without parent for now) and parse the values for each column. Columns with empty
             * text are not parsed (the value is left to null).
             */
            final TreeTable.Node node = new DefaultTreeTable.Node(table);
            try {
                matcher.region(indexOfValue, endOfLine);
                for (int ci=0; ci<columns.length; ci++) {
                    final boolean found = matcher.find();
                    int endOfColumn = found ? matcher.start() : endOfLine;
                    indexOfValue   = CharSequences.skipLeadingWhitespaces (text, indexOfValue, endOfColumn);
                    int endOfValue = CharSequences.skipTrailingWhitespaces(text, indexOfValue, endOfColumn);
View Full Code Here

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

        ArrayList<Match> tryMatch(String s, int start, int end) {
            ArrayList<Match> alm = new ArrayList<Match>();
            if (isPattern()) {
                //System.out.println("Try pmatch pattern \""+pattern+"\" at "+start+"-"+end);
                Matcher m = pattern.matcher(s);
                m.region(start, end);
                while (m.find()) {
                    //System.out.println("Matched "+m.start()+"-"+m.end());
                    Match mtch = new Match(m.start(), m.end(), this);
                    if (bindings!=null) {
                        int gc = Math.min(m.groupCount(), bindings.length);
View Full Code Here

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

                }
            } else {
                for (Pattern p: beg) {
                    //System.out.println("Try match \""+p+"\" at "+start+"-"+end);
                    Matcher m = p.matcher(s);
                    m.region(start, end);
                    // Find it only once: PE: ... Other PE: problem!
                    // Andreea Bodnari: we actually want to find the section
                    // if it is present multiple times
                    while (m.find()) {
                        //System.out.println("Matched "+m.start()+"-"+m.end());
View Full Code Here

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

                // If port is the attribute, then comma will not be used as a
                // delimiter
                if (attrName.equalsIgnoreCase("port") || attrName.equalsIgnoreCase("expires")) {
                    int start = matcher.regionStart();
                    matcher = ATTR_PATTERN0.matcher(headerString);
                    matcher.region(start, headerString.length());
                    matcher.lookingAt();
                } else if (cookie.getVersion() == 1 && attrName.startsWith(COMMA_STR)) {
                    // If the last encountered token is comma, and the parsed
                    // attribute is not port, then this attribute/value pair
                    // ends.
View Full Code Here

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

    int startPos = m.start();
    // Find end of form
     p = Pattern.compile("</form>");
//    p = getPattern("util.formEnd");
    m = p.matcher(page);
    m.region(startPos, page.length());
    // Confirm send resource does not have "</form>"
    int endPos = page.length();
    if (m.find()) {   
      endPos = m.end();
    }
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.