Examples of Perl5Matcher


Examples of org.apache.oro.text.regex.Perl5Matcher

  /// @throws MalformedPattern If pattern is invalid
  public static final Object[] p_split = new Object[] { null, "pattern" };
  public Any m_split(Context context, Any pattern_)
  {
    Pattern pattern = ObjectPool.createPattern(context, pattern_);
    Perl5Matcher matcher = new Perl5Matcher();
    Vector parts = Util.split(matcher, pattern, _string);
    int n = parts.size();
    Any[] list = new Any[n];
    for(int i=0; i<n; i++) {
      list[i] = Any.create(parts.elementAt(i).toString());
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

    } else {
      substitution = new AnyUtils.FunctionSubstitute(context, replacement);
    }
   
    Pattern pattern = ObjectPool.createPattern(context, pattern_);
    Perl5Matcher matcher = new Perl5Matcher();
    return Any.create(Util.substitute(matcher, pattern, substitution, _string, flags));
  }
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

          context = Context.getInstance();
        }
        throw context.exception(e);
      }
    }
    Perl5Matcher matcher = new Perl5Matcher();
    return matcher.contains(image.toString(), p);
  }
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

    return FALSE;
  }

  public Any execute(Context context, Any param1)
  {
    Perl5Matcher matcher = new Perl5Matcher();
    return matcher.contains(param1.toString(), _pattern) ? TRUE : FALSE;
  }
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

      if (matches_ instanceof AnyList) {
        list = (AnyList)matches_;
      }
    }
   
    Perl5Matcher matcher = new Perl5Matcher();
    if (isMatch ? matcher.matches(string, _pattern)
                : matcher.contains(string, _pattern))
    {
      if (array != null) {
        MatchResult match = matcher.getMatch();
        array.clear();
        int n = match.groups();
        for(int i=0; i<n; i++) {
          array.append(Any.create(match.group(i)));
        }
        return array;

      } else if (list != null) {
        MatchResult match = matcher.getMatch();
        list.clear();
        int n = match.groups();
        for(int i=0; i<n; i++) {
          list.append(Any.create(match.group(i)));
        }
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

  /// Splits given text to pieces according to this pattern.
  /// @synopsis array split(string text)
  public static final Object[] p_split = new Object[] { "text" };
  public Any m_split(String string)
  {
    Perl5Matcher matcher = new Perl5Matcher();
    Vector parts = Util.split(matcher, _pattern, string);
    Array array = new Array();
    int n = parts.size();
    for(int i=0; i<n; i++) {
      array.append(Any.create(parts.elementAt(i).toString()));
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

        substitution = new StringSubstitution(s);
      }
    } else {
      substitution = new AnyUtils.FunctionSubstitute(context, replacement);
    }
    Perl5Matcher matcher = new Perl5Matcher();
    return Any.create(Util.substitute(matcher, _pattern, substitution, string, substFlags));
  }
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

  {
    boolean match;
    Pattern kpattern = ObjectPool.createPattern(context, keyPattern);
    Pattern vpattern = ObjectPool.createPattern(context, valuePattern);
    if ((kpattern != null) || (vpattern != null)) {
      Perl5Matcher matcher = new Perl5Matcher();
      Array matched = new Array();
      Entry e = head;
      while(e != null) {
        Any key = e.key;
        Any value = e.value;
        if (kpattern != null) {
          match = matcher.contains(key.toString(), kpattern);
        } else {
          match = false;
        }
        if (vpattern != null) {
          if (both) {
            match = match && matcher.contains(value.toString(), vpattern);
          } else if (!match) {
            match = matcher.contains(value.toString(), vpattern);
          }
        }
        if (match) {
          matched.put(key, value);
        }
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

    String sEncoding;
  String sBaseHref = "";
  boolean bAutoDetectEncoding = true;
  TreeSet<String> oFiles = new TreeSet<String>();
  TreeSet<String> oEntries = new TreeSet<String>();
    Perl5Matcher oMatcher = new Perl5Matcher();
    Perl5Matcher oReplacer = new Perl5Matcher();
    Perl5Compiler oCompiler = new Perl5Compiler();

    try {
      String sHtml = readfilestr(sBasePath+sFilePath,"ASCII");
View Full Code Here

Examples of org.apache.oro.text.regex.Perl5Matcher

//            fail("Expected & length: " +contentLen + " in:\n"+requestHeaders);
//        }
    }
  
    private String getSentRequestHeaderValue(String requestHeaders, String headerName) {
        Perl5Matcher localMatcher = JMeterUtils.getMatcher();
        String expression = ".*" + headerName + ": (\\d*).*";
        Pattern pattern = JMeterUtils.getPattern(expression, Perl5Compiler.READ_ONLY_MASK | Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.SINGLELINE_MASK);
        if(localMatcher.matches(requestHeaders, pattern)) {
            // The value is in the first group, group 0 is the whole match
            return localMatcher.getMatch().group(1);
        }
        return null;
    }
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.