Package org.apache.oro.text.perl

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


        boolean ipV4Address = false;
        boolean hostname = false;
        // check if authority is IP address or hostname
        String hostIP = authorityMatcher.group( PARSE_AUTHORITY_HOST_IP );
        ipV4Address = matchIPV4Pat.match( IP_V4_DOMAIN_PATTERN, hostIP );

        if ( ipV4Address )
        {
            // this is an IP address so check components
            for ( int i = 1; i <= 4; i++ )
View Full Code Here


        }
        else
        {
            // Domain is hostname name
            Perl5Util domainMatcher = new Perl5Util();
            hostname = domainMatcher.match( DOMAIN_PATTERN, hostIP );
        }

        //rightmost hostname will never start with a digit.
        if ( hostname )
        {
View Full Code Here

            int segmentLength = 0;
            Perl5Util atomMatcher = new Perl5Util();

            while ( match )
            {
                match = atomMatcher.match( ATOM_PATTERN, hostIP );
                if ( match )
                {
                    domainSegment[segmentCount] = atomMatcher.group( 1 );
                    segmentLength = domainSegment[segmentCount].length() + 1;
                    hostIP = ( segmentLength >= hostIP.length() ) ? "" : hostIP.substring( segmentLength );
View Full Code Here

                return false;
            }

            // First letter of top level must be a alpha
            Perl5Util alphaMatcher = new Perl5Util();
            if ( !alphaMatcher.match( ALPHA_PATTERN, topLevel.substring( 0, 1 ) ) )
            {
                return false;
            }
        }
View Full Code Here

        String port = authorityMatcher.group( PARSE_AUTHORITY_PORT );
        if ( port != null )
        {
            Perl5Util portMatcher = new Perl5Util();
            if ( !portMatcher.match( PORT_PATTERN, port ) )
            {
                return false;
            }
        }
View Full Code Here

            return false;
        }

        Perl5Util pathMatcher = new Perl5Util();

        if ( !pathMatcher.match( PATH_PATTERN, path ) )
        {
            return false;
        }

        int slash2Count = countToken( "//", path );
View Full Code Here

        {
            return true;
        }

        Perl5Util queryMatcher = new Perl5Util();
        return queryMatcher.match( QUERY_PATTERN, query );
    }

    /**
     * Returns true if the given fragment is null or fragments are allowed.
     */
 
View Full Code Here

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

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

        // Check the whole email address structure
        Perl5Util emailMatcher = new Perl5Util();
View Full Code Here

            return false;
        }

        // 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 {
            // Domain is symbolic name
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.