Examples of toMatchResult()


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

      lastRegex = regex;
      p = Pattern.compile(regex);
    }
    Matcher m = p.matcher(s);
    if (m.find()) {
      MatchResult mr = m.toMatchResult();
      return mr.group(extractIndex);
    }
    return "";
  }
View Full Code Here

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

        while (iter.hasNext()) {
            String entry = iter.next().trim();
            MatchResult result = null;
            Matcher _preparse_matcher_ = _preparse_pattern_.matcher(entry);
            if (_preparse_matcher_.matches()) {
                result = _preparse_matcher_.toMatchResult();
                String name = result.group(1);
                String version = result.group(2);
                Integer nv = Integer.valueOf(version);
                Integer existing = existingEntries.get(name);
                if (null != existing) {
View Full Code Here

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

        while (iter.hasPrevious()) {
            String entry = iter.previous().trim();
            MatchResult result = null;
            Matcher _preparse_matcher_ = _preparse_pattern_.matcher(entry);
            if (_preparse_matcher_.matches()) {
                result = _preparse_matcher_.toMatchResult();
                String name = result.group(1);
                String version = result.group(2);
                Integer nv = Integer.valueOf(version);
                Integer existing = existingEntries.get(name);
                if (null != existing) {
View Full Code Here

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

    Pattern pattern = Pattern.compile(regexpString, Pattern.MULTILINE | Pattern.DOTALL);
    Matcher matcher = pattern.matcher(document);
    int groupCount = matcher.groupCount();
    while (matcher.find()) {
      RegExpRuleMatch ruleMatch = new RegExpRuleMatch(this);
      MatchResult matchResult = matcher.toMatchResult();
      for (int i = 0; i <= groupCount; i++) {
        int begin = matchResult.start(i);
        int end = matchResult.end(i);
        List<Type> types = groupTypes.get(i);
        if (types != null) {
View Full Code Here

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

                    this.chunkString(characterEvents,
                            buffer.subSequence(prevMatchEnd, matcher.start()),
                            patternIndex + 1);

                    //Get the generated CharacterEvents for the match
                    final MatchResult matchResult = matcher.toMatchResult();
                    eventSource.generateCharacterEvents(this.request, matchResult, characterEvents);
                   
                    prevMatchEnd = matcher.end();
                } while (matcher.find());
View Full Code Here

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

    if (parentBinding != null) {
      path = parentBinding.getPastBinding();
    }
    Matcher matcher = regex.matcher(path);
    if (matcher.matches()) {
      MatchResult matchResult = matcher.toMatchResult();
      String boundPath = matchResult.group(1);
      ImmutableMap.Builder<String, String> paramsBuilder = ImmutableMap.builder();
      int i = 2;
      for (String name : tokenNames) {
        String value = matchResult.group(i++);
View Full Code Here

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

    private MatchResult getMatchResult(String pattern, String input) {
        Matcher matcher = Pattern.compile(pattern).matcher(input);

        assertTrue(matcher.find());

        return matcher.toMatchResult();
    }

    @Test
    public void emptyResult() {
        assertEquals(0, MatchResultSubstitution.EMPTY_MATCH_RESULT.groupCount());
View Full Code Here

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

    Pattern pattern = Pattern.compile(regexpString, Pattern.MULTILINE | Pattern.DOTALL);
    Matcher matcher = pattern.matcher(document);
    int groupCount = matcher.groupCount();
    while (matcher.find()) {
      RegExpRuleMatch ruleMatch = new RegExpRuleMatch(this);
      MatchResult matchResult = matcher.toMatchResult();
      for (int i = 0; i <= groupCount; i++) {
        int begin = matchResult.start(i);
        int end = matchResult.end(i);
        List<Type> types = groupTypes.get(i);
        if (types != null) {
View Full Code Here

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

    private MatchResult getMatchResult(String pattern, String input) {
        Matcher matcher = Pattern.compile(pattern).matcher(input);

        assertTrue(matcher.find());

        return matcher.toMatchResult();
    }

    @Test
    public void emptyResult() {
        assertEquals(0, MatchResultSubstitution.EMPTY_MATCH_RESULT.groupCount());
View Full Code Here

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

                                              "  Length: ā€˜%sā€˜"      + sep +
                                              "  Conversion: ā€˜%sā€˜"  + sep,
                                              key, flags, width, precision, length, conversion);
                        }
                       
                        conv = new PercentConversion(this, tokenMatcher.toMatchResult());
                        //System.out.println("Conversion.toString = " + conv.toString());
                        conversions.add(conv);
                    }
                }
               
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.