Package org.apache.oro.text.regex

Examples of org.apache.oro.text.regex.Perl5Matcher.matches()


      //loop the matches
      while (matcher.contains(input, pattern)) {
        result = matcher.getMatch();
        url = result.group(2);
        PatternMatcherInput input1 = new PatternMatcherInput(url);
        if (!matcher1.matches(input1, pattern1)) {
          //if (LOG.isTraceEnabled()) { LOG.trace(" - invalid '" + url + "'"); }
          continue;
        }
        if (url.startsWith("www.")) {
            url = "http://" + url;
View Full Code Here


                } else if (equals) {
                    found = toCheck.equals(stringPattern);
                } else if (substring) {
                    found = toCheck.indexOf(stringPattern) != -1;
                } else {
                    found = localMatcher.matches(toCheck, pattern);
                }
                pass = notTest ? !found : found;
                if (!pass) {
                    if (debugEnabled){log.debug("Failed: "+stringPattern);}
                    result.setFailure(true);
View Full Code Here

            }
        }

        final String path = config.getPath();
        if (!newLink.getPath().equals(path)
                && !matcher.matches(newLink.getPath(), patternCache.getPattern("[/]*" + path, // $NON-NLS-1$
                        Perl5Compiler.READ_ONLY_MASK))) {
            return false;
        }

        PropertyIterator iter = arguments.iterator();
View Full Code Here

                                setParentSampleSuccess(res, false);
                                continue;
                            }
                        }
                        // I don't think localMatcher can be null here, but check just in case
                        if (pattern != null && localMatcher != null && !localMatcher.matches(urlStrEnc, pattern)) {
                            continue; // we have a pattern and the URL does not match, so skip it
                        }
                       
                        if (isConcurrentDwn()) {
                            // if concurrent download emb. resources, add to a list for async gets later
View Full Code Here

    private void setFieldsValues(String value) {
        if (value == null) {
            resetFieldsValues();
        } else {
            PatternMatcher matcher = new Perl5Matcher();
            if (matcher.matches(value, getAggregateFieldDefinition().getSplitPattern())) {
                MatchResult matchResult = matcher.getMatch();
                Iterator iterator = getAggregateFieldDefinition().getSplitMappingsIterator();
                while (iterator.hasNext()) {
                    SplitMapping splitMapping = (SplitMapping)iterator.next();
                    String result = matchResult.group(splitMapping.getGroup());
View Full Code Here

        return hasFailMessage() ? getFailMessage() : new ValidationError(new I18nMessage("validation.string.regexp", new String[] {regexp}, Constants.I18N_CATALOGUE));
    }
   
    private boolean matchesRegExp(String string) {
        PatternMatcher matcher = new Perl5Matcher();
        return matcher.matches(string, pattern);
    }
   
    void setPattern(String regexp, Pattern pattern) {
        this.regexp = regexp;
      this.pattern = pattern;
View Full Code Here

            {
                /** perl5 matcher */
                Perl5Matcher patternMatcher = new Perl5Matcher();
           
                boolean patternMatch =
                        patternMatcher.matches(testValue, maskPattern);

                log.debug("Trying to match " + testValue
                        + " to pattern " + maskString);

                if (!patternMatch)
View Full Code Here

                              res.setSuccessful(false);
                              continue;
                          }
                      }
                      // I don't think localMatcher can be null here, but check just in case
                      if (pattern != null && localMatcher != null && !localMatcher.matches(urlStrEnc, pattern)) {
                        continue; // we have a pattern and the URL does not match, so skip it
                      }
                      HTTPSampleResult binRes = sample(url, GET, false, frameDepth + 1);
            res.addSubResult(binRes);
            res.setSuccessful(res.isSuccessful() && binRes.isSuccessful());
View Full Code Here

  
    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

                } else if (equals) {
                    found = toCheck.equals(stringPattern);
                } else if (substring) {
                    found = toCheck.indexOf(stringPattern) != -1;
        } else {
          found = localMatcher.matches(toCheck, pattern);
        }
        pass = not ? !found : found;
        if (!pass) {
          if (debugEnabled){log.debug("Failed: "+pattern);}
          result.setFailure(true);
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.