HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Problem with filter ranges
Author: Marcus Sundman
Date: 02/08/2008 05:12
 
> > > The manual says * matches 0 or more.  
> > 
> > That's irrelevant. What's relevant is if *[0-9]
> > matches 0 characters (which would be stupid since
> > then it would always match and it would be
> > pointless).
> 
> The manual says * matches 0 or more, NOT 1 or more.

Why do you think it's relevant what "*" matches? We're talking about "*[0-9]",
not about "*".

Also, as far as I can see the manual doesn't say "*[0-9]" matches 0
characters, and only hints at "*" matching 0 characters. It says that "*[a-z]"
matches "any letters" (not "any letters or none"), and implies that "*[0-9]"
matches "any characters among 0..9" (not "any characters among 0..9, or no
character").

An extremely liberal interpretation of the word "any" _could_ include "none"
in one or more places in the manual. That'd be very counterintuitive, though.
(E.g., if someone asks you "Do you have any apples?" then you can't truthfully
answer "Yes. I have 0 apples.")

Anyway, if "*[0-9]" really does match 0 characters, then how do I write a
filter that matches 1 or more characters among 0..9?
> "*album=*[0-9]" matches the "album=" part but wont
> match album=foo

Why not?
Tell me at what point the following reasoning breaks:

"*album=" matches the substring "album=", right?
"*[0-9]" matches any characters among 0..9 or 0 characters (according to you),
right?
Then it should follow that "*album=*[0-9]" should match the substring "album="
followed by 0 or more characters among 0..9. Thus "*album=*[0-9]" should match
"album=" (because it is "album=" followed by 0 characters among 0..9).

Furthermore, the existence of "*[]" implies that there need not be a wildcard
to match the last part of the URL. Thus it should be irrelevant what is
appended to the end of an URL if the filter doesn't end with "*[]", right?
From that follows that if "*album=*[0-9]" matches "album=" then it also
matches "album=foo".

By the laws of logic: At least one premise in the reasoning is wrong (if so,
which one?) or the logical reasoning is unsound (if so, in what way?) or
you're wrong (if so, "*album=*[0-9]" matches "album=foo").

Still, my original problem remains, i.e., how do I write a filter that matches
"album=" followed by 1 or more characters among 0..9 followed by anything?
 
Reply Create subthread


All articles

Subject Author Date
Problem with filter ranges

02/07/2008 14:26
Re: Problem with filter ranges

02/07/2008 17:18
Re: Problem with filter ranges

02/07/2008 20:39
Re: Problem with filter ranges

02/07/2008 22:04
Re: Problem with filter ranges

02/08/2008 01:19
Re: Problem with filter ranges

02/08/2008 03:47
Re: Problem with filter ranges

02/08/2008 05:12
Re: Problem with filter ranges

02/08/2008 05:32
Re: Problem with filter ranges

02/08/2008 05:45
Re: Problem with filter ranges

02/08/2008 06:14
Re: Problem with filter ranges

02/08/2008 16:58
Re: Problem with filter ranges

02/12/2008 15:02
Re: Problem with filter ranges

06/25/2011 05:36




6

Created with FORUM 2.0.11