Package com.dotcms.repackage.org.apache.oro.text.regex

Examples of com.dotcms.repackage.org.apache.oro.text.regex.MatchResult


    String tb = template.getBody();
    Perl5Matcher matcher = (Perl5Matcher) localP5Matcher.get();
    String oldParse;
    String newParse;
      while(matcher.contains(tb, parseContainerPattern)){
         MatchResult match = matcher.getMatch();
        int groups = match.groups();
         for(int g=0;g<groups;g++){
           oldParse = match.group(g);
           if(matcher.contains(oldParse, oldContainerPattern)){
             MatchResult matchOld = matcher.getMatch();
             newParse = matchOld.group(0).trim();
             newParse = containerTag + newParse + "')";
             tb = StringUtil.replace(tb,oldParse,newParse);
           }
         }
         template.setBody(tb);
View Full Code Here


    private String cleanKey(String key) {
      if(key.startsWith(ResourceManager.RESOURCE_TEMPLATE + ""))
        key=key.substring((ResourceManager.RESOURCE_TEMPLATE+"").length());
      Perl5Matcher matcher = (Perl5Matcher) localP5Matcher.get();
      if(matcher.contains(key, menuPattern)){
        MatchResult match = matcher.getMatch();
        key = match.group(0);
      }else{
        if(matcher.contains(key, assetPattern)){
          MatchResult match = matcher.getMatch();
            key = match.group(0);
        }
      }
      if (key.startsWith(File.separatorChar +"")) {
        key=key.substring(1);
      }
View Full Code Here

    } catch (MalformedPatternException e) {
      Logger.error(RegEX.class, "Unable to compile pattern for regex", e);
      throw new DotRuntimeException("Unable to compile pattern for regex",e);
    }
    List<RegExMatch> res = new ArrayList<RegExMatch>();
    MatchResult result;
    PatternMatcherInput input = new PatternMatcherInput(text);
    while (matcher.contains(input, pattern)) {
      RegExMatch rm = new RegExMatch();
      result = matcher.getMatch();
      if(!isUrlMap || result.beginOffset(0) == 0){
        rm.setMatch(result.group(0));
        rm.setBegin(result.beginOffset(0));
        rm.setEnd(result.endOffset(0));
        List<RegExMatch> r = new ArrayList<RegExMatch>();
        for(int group = 1; group < result.groups(); group++) {
          RegExMatch rm1 = new RegExMatch();
          rm1.setMatch(result.group(group));
          rm1.setBegin(result.begin(group));
          rm1.setEnd(result.end(group));
          r.add(rm1);
        }
        rm.setGroups(r);
        res.add(rm);
      }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.oro.text.regex.MatchResult

Copyright © 2018 www.massapicom. 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.