Package org.apache.oro.text.regex

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


                } 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


            {
                /** 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

            if( m_include != null )
            {
                for( int j = 0; j < m_include.length; j++ )
                {
                    if( pm.matches( pageName, m_include[j] ) )
                    {
                        includeThis = true;
                        break;
                    }
                }
View Full Code Here

            if( m_exclude != null )
            {
                for( int j = 0; j < m_exclude.length; j++ )
                {
                    if( pm.matches( pageName, m_exclude[j] ) )
                    {
                        includeThis = false;
                        break; // The inner loop, continue on the next item
                    }
                }
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

            // where the non-word char (\2) is the same
            // e.g. abc|def|ghi but not abd|def~ghi
                    .getPattern("\\w+((\\W)\\w+)?(\\2\\w+)*(\\2\"\\w+\")*", // $NON-NLS-1$
                            // last entries may be quoted strings
                            Perl5Compiler.READ_ONLY_MASK);
            if (matcher.matches(input, pattern)) {
                delim = matcher.getMatch().group(2);
                parts = splitHeader(headerLine, delim);// now validate the
                                                       // result
            }
        }
View Full Code Here

        }

        while (iter.hasNext()) {
            EntryHolder entryHolder = (EntryHolder) iter.next();

            boolean matched = matcher.matches(url, entryHolder.getCompiledPattern());

            if (logger.isDebugEnabled()) {
                logger.debug("Candidate is: '" + url + "'; pattern is " + entryHolder.getCompiledPattern().getPattern()
                    + "; matched=" + matched);
            }
View Full Code Here

        // Sql Server maintains the default values for DATE/TIME jdbc types, so we have to
        // migrate the default value to TIMESTAMP
        PatternMatcher matcher   = new Perl5Matcher();
        Timestamp      timestamp = null;
 
        if (matcher.matches(defaultValue, _isoDatePattern))
        {
          timestamp = new Timestamp(Date.valueOf(matcher.getMatch().group(1)).getTime());
        }
        else if (matcher.matches(defaultValue, _isoTimePattern))
        {
View Full Code Here

 
        if (matcher.matches(defaultValue, _isoDatePattern))
        {
          timestamp = new Timestamp(Date.valueOf(matcher.getMatch().group(1)).getTime());
        }
        else if (matcher.matches(defaultValue, _isoTimePattern))
        {
          timestamp = new Timestamp(Time.valueOf(matcher.getMatch().group(1)).getTime());
        }
        if (timestamp != null)
        {
View Full Code Here

            validationError = null;
   
            if (enteredValue != null) {
                // try to split it
                PatternMatcher matcher = new Perl5Matcher();
                if (matcher.matches(enteredValue, aggregateDefinition.getSplitPattern())) {
                    MatchResult matchResult = matcher.getMatch();
                    Iterator iterator = aggregateDefinition.getSplitMappingsIterator();
                    while (iterator.hasNext()) {
                        SplitMapping splitMapping = (SplitMapping)iterator.next();
                        String result = matchResult.group(splitMapping.getGroup());
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.