Package org.apache.regexp

Examples of org.apache.regexp.RE.match()


     * @return Scheme of the URI.
     */
    public static String getAuthority(String uri) {
        RE re = new RE(uripattern);

        if (re.match(uri)) {
            return re.getParen(4);
        } else {
            throw new IllegalArgumentException("'"+uri+
                                               "' is not a correct URI");
        }
View Full Code Here


     * @return Path of the URI.
     */
    public static String getPath(String uri) {
        RE re = new RE(uripattern);

        if (re.match(uri)) {
            return re.getParen(5);
        } else {
            throw new IllegalArgumentException("'"+uri+
                                               "' is not a correct URI");
        }
View Full Code Here

     * @return Path of the URI.
     */
    public static String getPathWithoutAuthority(String uri) {
        RE re = new RE(uripattern);

        if (re.match(uri)) {
            return re.getParen(4)+re.getParen(5);
        } else {
            throw new IllegalArgumentException("'"+uri+
                                               "' is not a correct URI");
        }
View Full Code Here

     * @return Query of the URI.
     */
    public static String getQuery(String uri) {
        RE re = new RE(uripattern);

        if (re.match(uri)) {
            return re.getParen(7);
        } else {
            throw new IllegalArgumentException("'"+uri+
                                               "' is not a correct URI");
        }
View Full Code Here

     * @return Fragment of the URI.
     */
    public static String getFragment(String uri) {
        RE re = new RE(uripattern);

        if (re.match(uri)) {
            return re.getParen(9);
        } else {
            throw new IllegalArgumentException("'"+uri+
                                               "' is not a correct URI");
        }
View Full Code Here

                if (getLogger().isDebugEnabled())
                    getLogger().debug(
                        "String parameter " + name + " should match regexp \"" + regex + "\"");
                try {
                    RE r = new RE(regex);
                    if (!r.match(value)) {
                        if (getLogger().isDebugEnabled())
                            getLogger().debug("and it does not match");
                        return new ValidatorActionHelper(value, ValidatorActionResult.NOMATCH);
                    }
                } catch (RESyntaxException rese) {
View Full Code Here

        final String s = url.toString();
        Iterator i = excludeCrawlingURL.iterator();
        while (i.hasNext()) {
            RE pattern = (RE) i.next();
            if (pattern.match(s)) {
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("exclude URL " + url);
                }
                return true;
            }
View Full Code Here

        final String s = url.toString();
        Iterator i = includeCrawlingURL.iterator();
        while (i.hasNext()) {
            RE pattern = (RE) i.next();
            if (pattern.match(s)) {
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("include URL " + url);
                }
                return true;
            }
View Full Code Here

       
        final String s = url.toString();
        Iterator i = excludeCrawlingURL.iterator();
        while (i.hasNext()) {
            RE pattern = (RE) i.next();
            if (pattern.match(s)) {
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Excluded URL " + url);
                }
                return true;
            }
View Full Code Here

       
        final String s = url.toString();
        Iterator i = includeCrawlingURL.iterator();
        while (i.hasNext()) {
            RE pattern = (RE) i.next();
            if (pattern.match(s)) {
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Included URL " + url);
                }
                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.