Package org.apache.oro.text.regex

Examples of org.apache.oro.text.regex.MatchResult.groups()


        if (!matches(input, options)) {
            return null;
        }
        Vector v = new Vector();
        MatchResult mr = matcher.getMatch();
        int cnt = mr.groups();
        for (int i = 0; i < cnt; i++) {
            String match = mr.group(i);
            // treat non-matching groups as empty matches
            if (match == null) {
                match = "";
View Full Code Here


          Pattern pattern = new Perl5Compiler().compile(targetString.substring("regex:".length(), msgPos));
          Perl5Matcher matcher = new Perl5Matcher();

          if (matcher.matches(address.toString(), pattern)) {
              MatchResult match = matcher.getMatch();
              Map parameters = new HashMap(match.groups());
              for (int i = 1; i < match.groups(); i++) {
                  parameters.put(Integer.toString(i), match.group(i));
              }
              result = XMLResources.replaceParameters(targetString.substring(msgPos + 1), parameters);
          }
View Full Code Here

          Perl5Matcher matcher = new Perl5Matcher();

          if (matcher.matches(address.toString(), pattern)) {
              MatchResult match = matcher.getMatch();
              Map parameters = new HashMap(match.groups());
              for (int i = 1; i < match.groups(); i++) {
                  parameters.put(Integer.toString(i), match.group(i));
              }
              result = XMLResources.replaceParameters(targetString.substring(msgPos + 1), parameters);
          }
      }
View Full Code Here

        if (!matches(input, options)) {
            return null;
        }
        Vector v = new Vector();
        MatchResult mr = matcher.getMatch();
        int cnt = mr.groups();
        for (int i = 0; i < cnt; i++) {
            String match = mr.group(i);
            // treat non-matching groups as empty matches
            if (match == null) {
                match = "";
View Full Code Here

            }
        } else // if ! isPathExtension()
        {
            if (matcher.contains(text, parameterRegexp)) {
                MatchResult result = matcher.getMatch();
                for (int i = 1; i < result.groups(); i++) {
                    value = result.group(i);
                    if (value != null) {
                        break;
                    }
                }
View Full Code Here

        while (matcher.contains(input, pattern))
        {
            MatchResult match= matcher.getMatch();
            String s;
            if (log.isDebugEnabled())
                log.debug("match groups " + match.groups());
            // Check for a BASE HREF:
            for (int g=1; g <= NUM_BASE_GROUPS && g <= match.groups(); g++)
            {
                s= match.group(g);
                if (s != null)
View Full Code Here

            MatchResult match= matcher.getMatch();
            String s;
            if (log.isDebugEnabled())
                log.debug("match groups " + match.groups());
            // Check for a BASE HREF:
            for (int g=1; g <= NUM_BASE_GROUPS && g <= match.groups(); g++)
            {
                s= match.group(g);
                if (s != null)
                {
                    if (log.isDebugEnabled())
View Full Code Here

                                e);
                        }
                    }
                }
            }
            for (int g= NUM_BASE_GROUPS+1; g <= match.groups(); g++)
            {
                s= match.group(g);
                if (log.isDebugEnabled())
                {
                    log.debug("group " + g + " - " + match.group(g));
View Full Code Here

    final Pattern pattern = definition.getPattern();
    if (pattern == null) return null;
    final Perl5Matcher matcher = new Perl5Matcher();
    if (matcher.contains(step.getStepName(), pattern)) {
      final MatchResult match = matcher.getMatch();
      final int groupCount = match.groups();
      for (int i = 1; i < groupCount; i++) {
        final int start = match.beginOffset(i);
        final int end = match.endOffset(i);
        if (start >= 0 && end >= 0) {
          parameterRanges.add(new TextRange(start, end).shiftRight(shiftOffset));
View Full Code Here

       
        assertTrue(util.match(expr, JAVASCRIPT_NOCOMMENT));
       
        MatchResult result = util.getMatch();
        assertNotNull(result);
        assertEquals(3, result.groups());
        assertEquals("if (document.updateObject) { document.updateObject.progressFinished('updateId');}",
                result.group(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.