[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn:ignore Question

From: Michael Wood <mwood_at_its.uct.ac.za>
Date: 2003-07-22 09:33:21 CEST

On Mon, Jul 21, 2003 at 10:31:44AM -0400, Paul Lussier wrote:
> In a message dated: Fri, 18 Jul 2003 16:23:22 PDT
> Justin Erenkrantz said:
>
> >Namely, I believe fnmatch doesn't support [xyz]* expressions. I could be
> >wrong, but that's what the Solaris man page on fnmatch(5) leads me to
> >believe.
>
> Prior to your explanation, I had no knowledge of how svn dealt with
> regexes. However, after reading the man page for fnmatch(3) for
> Linux, I find that it simply states:
[snip]
> NOTES
> Regular expressions
> Note that wildcard patterns are not regular expressions,
> although they are a bit similar. First of all, they match
> filenames, rather than text, and secondly, the conventions
> are not the same: e.g., in a regular expression `*' means
> zero or more copies of the preceding thing.
>
> Now that regular expressions have bracket expressions
> where the negation is indicated by a `^', POSIX has
> declared the effect of a wildcard pattern `[^...]' to be
> undefined.
>
> So, IMO, [m-n]* _should_ work, but the above leads me to believe that
> it might not :)

Paul, you are confusing shell globbing with regular expressions. They
are not the same thing (although shell globbing is sometimes incorrectly
referred to as regular expression matching.)

e.g., The wildcard pattern, *.* would match any filename containing at
least one dot (except for a filename beginning with a dot) but it is NOT
a valid regular expression. DOS filename wildcard patterns are similar,
but different. An equivalent perl compatible regular expression would
be:
^[^.]+\..*$ (but this is not the only way to write it.)

Written using regular expressions you might find in a Computer Science
theory text book the above would look horrendously long, since it would
have explicitly to mention every character that it is possible to
include in a filename. Assuming only the characters "a", "b" and "."
can appear in a filename, it might look like this:
(a + b)(a + b)* . (a + b + .)*
(where the asterisks are superscripted.)

> Anyone know for certain either way?

You're talking about two separate, but vaguely similar things :) I
agree that glob(7) does imply that character classes are part of POSIX,
in which case, I would expect APR to support them.

A brief look at src/apr/strings/apr_fnmatch.c implies that APR does
indeed support them.

-- 
Michael Wood <mwood@its.uct.ac.za>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 22 09:34:38 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.