W3C home > Mailing lists > Public > www-validator@w3.org > March 2009

Re: checklink : Is it possible to check limited url regex?

From: Ville Skyttä <ville.skytta@iki.fi>
Date: Tue, 10 Mar 2009 21:25:33 +0200
To: www-validator@w3.org
Message-Id: <200903102125.34397.ville.skytta@iki.fi>
On Tuesday 10 March 2009, howard chen wrote:
> For example.
>
> -X, --exclude regexp
> Do not check links whose full, canonical URIs match regexp. Note that
> this option limits recursion the same way as --exclude-docs with the
> same regular expression would.
>
>
> But I want to check only under a certain subdomain, e.g.
> http://a.example.com
>
> Is it possible currently?

Yes, but it's quite hairy.  If interested in details, check out look-around 
assertions in the Perl regular expressions documentation ("man perlre" in 
Unixish systems).

This should work for http://a.example.com:

-X '(?!^http://a\.example\.com).{20}/'

The magic number 20 is the number of characters in http://a.example.com.  For 
https://foo.example.com it would be 23 etc.
Received on Tuesday, 10 March 2009 19:26:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:34 GMT