Package org.apache.oro.text.perl

Examples of org.apache.oro.text.perl.Perl5Util.match()


                return false;
            }
        } else {
            // Domain is symbolic name
            Perl5Util domainMatcher = new Perl5Util();
            symbolic = domainMatcher.match(DOMAIN_PATTERN, domain);
        }

        if (symbolic) {
            if (!isValidSymbolicDomain(domain)) {
                return false;
View Full Code Here


     * Returns true if the user component of an email address is valid.
     * @param user being validated
     */
    protected boolean isValidUser(String user) {
        Perl5Util userMatcher = new Perl5Util();
        return userMatcher.match(USER_PATTERN, user);
    }

    /**
     * Validates an IP address. Returns true if valid.
     * @param ipAddressMatcher Pattren matcher
View Full Code Here

        boolean match = true;
        int i = 0;
        Perl5Util atomMatcher = new Perl5Util();

        while (match) {
            match = atomMatcher.match(ATOM_PATTERN, domain);
            if (match) {
                domainSegment[i] = atomMatcher.group(1);
                int l = domainSegment[i].length() + 1;
                domain =
                        (l >= domain.length())
View Full Code Here

    ActionErrors errors = super.validate(mapping, request);
        Iterator it = getKeys().iterator();
    Perl5Util util = new Perl5Util();
        while (it.hasNext()) {
            String key = (String) it.next();
            if(!util.match("/^[a-fA-F0-9]{6}$/",(String) getValue(key))){
        errors.add(key, new ActionError("errors.color",key));
            }
        }

        return errors;
View Full Code Here

        ActionErrors errors, HttpServletRequest request) {
        String value = ValidatorUtil.getValueAsString(bean, field.getProperty());
        Perl5Util util = new Perl5Util();

        if (!GenericValidator.isBlankOrNull(value)) {
            if ((!util.match(
                        "/( )|(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)|(^_+@)|(^\\-+@)/",
                        value)) &&
                    util.match(
                        "/^[\\w\\'\\.\\-]+@((\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)|[a-zA-Z0-9\\-]{2,})$/",
                        value)) {
View Full Code Here

        if (!GenericValidator.isBlankOrNull(value)) {
            if ((!util.match(
                        "/( )|(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)|(^_+@)|(^\\-+@)/",
                        value)) &&
                    util.match(
                        "/^[\\w\\'\\.\\-]+@((\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)|[a-zA-Z0-9\\-]{2,})$/",
                        value)) {
                return true;
            } else {
                try {
View Full Code Here

        if (regexp == null || regexp.length() <= 0) {
            return false;
        }

        Perl5Util matcher = new Perl5Util();
        return matcher.match("/" + regexp + "/", value);
    }

    /**
     * <p>
     * Checks if the value can safely be converted to a byte primitive.
View Full Code Here

        if (email == null) {
            return false;
        }

        Perl5Util matchAsciiPat = new Perl5Util();
        if (!matchAsciiPat.match(LEGAL_ASCII_PATTERN, email)) {
            return false;
        }

        email = stripComments(email);
View Full Code Here

        email = stripComments(email);

        // Check the whole email address structure
        Perl5Util emailMatcher = new Perl5Util();
        if (!emailMatcher.match(EMAIL_PATTERN, email)) {
            return false;
        }

        if (email.endsWith(".")) {
            return false;
View Full Code Here

     */
    protected boolean isValidDomain(String domain) {
        boolean symbolic = false;
        Perl5Util ipAddressMatcher = new Perl5Util();

        if (ipAddressMatcher.match(IP_DOMAIN_PATTERN, domain)) {
            if (!isValidIpAddress(ipAddressMatcher)) {
                return false;
            } else {
                return 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.