Package org.apache.oro.text.regex

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


                            {
                                use = false;

                                for( int n = 0; !use && n < include.length; n++ )
                                {
                                    use = matcher.matches( name, include[n] );
                                }
                            }

                            // did we specify what pages to exclude?
                            if( use && null != exclude )
View Full Code Here


                            // did we specify what pages to exclude?
                            if( use && null != exclude )
                            {
                                for( int n = 0; use && n < exclude.length; n++ )
                                {
                                    use &= !matcher.matches( name, exclude[n] );
                                }
                            }

                            if( use )
                            {
View Full Code Here

            validationError = null;
   
            if (enteredValue != null) {
                // try to split it
                PatternMatcher matcher = new Perl5Matcher();
                if (matcher.matches(enteredValue, definition.getSplitPattern())) {
                    MatchResult matchResult = matcher.getMatch();
                    Iterator iterator = definition.getSplitMappingsIterator();
                    while (iterator.hasNext()) {
                        SplitMapping splitMapping = (SplitMapping)iterator.next();
                        String result = matchResult.group(splitMapping.getGroup());
View Full Code Here

        try {
            pattern = pc.compile("havana_us_.*", Perl5Compiler.DEFAULT_MASK);
        } catch (MalformedPatternException e) {
            throw new ConfigException(e);
        }
        boolean ismatch = matcher.matches("havana_us_0001", pattern);
        System.out.println(ismatch);
    }
}
View Full Code Here

        if (!StringUtil.isBlank(action)) {
            PatternMatcher matcher = new Perl5Matcher();
            Iterator<ActionPatternHolder> iter = actionPatternList.iterator();
            while (iter.hasNext()) {
                ActionPatternHolder holder = (ActionPatternHolder) iter.next();
                if (StringUtils.isNotEmpty(action) && matcher.matches(action, holder.getActionPattern())
                    && StringUtils.isNotEmpty(method) && matcher.matches(method, holder.getMethodPattern())) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Candidate is: '" + action + "|" + method + "'; pattern is "
                                     + holder.getActionName() + "|" + holder.getMethodName() + "; matched=true");
                    }
View Full Code Here

            PatternMatcher matcher = new Perl5Matcher();
            Iterator<ActionPatternHolder> iter = actionPatternList.iterator();
            while (iter.hasNext()) {
                ActionPatternHolder holder = (ActionPatternHolder) iter.next();
                if (StringUtils.isNotEmpty(action) && matcher.matches(action, holder.getActionPattern())
                    && StringUtils.isNotEmpty(method) && matcher.matches(method, holder.getMethodPattern())) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Candidate is: '" + action + "|" + method + "'; pattern is "
                                     + holder.getActionName() + "|" + holder.getMethodName() + "; matched=true");
                    }
                    return true;
View Full Code Here

        Iterator<URLPatternHolder> iter = urlProtectedList.iterator();

        while (iter.hasNext()) {
            URLPatternHolder holder = (URLPatternHolder) iter.next();

            if (matcher.matches(requestUrl, holder.getCompiledPattern())) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Candidate is: '" + requestUrl + "'; pattern is "
                                 + holder.getCompiledPattern().getPattern() + "; matched=true");
                }
                return true;
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()
View Full Code Here

        return hasFailMessage() ? getFailMessage() : new ValidationError("validation.string.regexp", new String[] {regexp});
    }
   
    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

        }

        if (enteredValue != null) {
            // try to split it
            PatternMatcher matcher = new Perl5Matcher();
            if (matcher.matches(enteredValue, definition.getSplitPattern())) {
                MatchResult matchResult = matcher.getMatch();
                Iterator iterator = definition.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.