|
Posted by Seb on 10/07/06 17:38
Thanks.
I guess all my actual files would be file extensions (.htm etc) whereas
a path segment wouldn't.
The question was around which regular expression I can use to access
something with 4 slashes, and which does not finish with ".***" or
".****".
Thanks,
Seb
usenet+2004@john.dunlop.name wrote:
> Seb:
>
> > I am trying to find the right regular expression which would only
> > validate a URL with a given number of folders.
>
> URLs don't have, or refer to, folders. The parts in between the
> slashes in URL paths are called path segments, and they might or might
> not correspond to a part of a filesystem.
>
> > http://www.abc.com/folder/page.htm --> Valid (4 slahes)
> >
> > http://www.abc.com/folder/subfolder/ --> not valid (5 slashes)
> >
> > Basically, any URL not made of 4 slahes would be invalid.
>
> Count the number of slashes in the string.
>
> > http://www.abc.com/folder/subfolder --> would also be invalid
>
> How would you distinguish that URL from your first example?
>
> Now you see the problems arising from the confusion of URL paths and
> filesystem paths.
>
> --
> Jock
Navigation:
[Reply to this message]
|