Date: Sun, 23 Oct 2005 14:02:22 +0200 From: Stefan Farfeleder <stefanf@FreeBSD.org> To: Colin Percival <cperciva@freebsd.org> Cc: cvs-src@FreeBSD.org, Stefan Farfeleder <stefanf@FreeBSD.org>, cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/gnu/usr.bin/grep grep.1 Message-ID: <20051023120218.GB576@wombat.fafoe.narf.at> In-Reply-To: <435B75CD.7040903@freebsd.org> References: <200510231119.j9NBJuLF094528@repoman.freebsd.org> <435B75CD.7040903@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Oct 23, 2005 at 04:36:45AM -0700, Colin Percival wrote: > Stefan Farfeleder wrote: > > Modified files: > > gnu/usr.bin/grep grep.1 > > Log: > > Document [:blank:]. > > The text now claims that [:alnum:], [:alpha:], [:blank:] ... [:space:] ... > are self-explanatory names. While I've managed to work out the difference > between :blank: and :space: by looking at the source code (:blank: matches > [ \t], while :space: matches [ \f\n\r\t\v] and possibly other characters > depending upon the locale), I have trouble accepting that this difference > is obvious from the names. > > Could you add some text explaining this difference? Well, I think many of those aren't really self-explanatory (eg. [:cntrl:], [:graph:], [:print:]) if you don't know the C library. Here's a patch that refers to ctype(3), though I'm not sure how to do that correctly because grep(1) isn't in mdoc format. Stefan --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="grep.1.diff" Index: grep.1 =================================================================== RCS file: /home/ncvs/src/gnu/usr.bin/grep/grep.1,v retrieving revision 1.27 diff -I.svn -u -r1.27 grep.1 --- grep.1 23 Oct 2005 11:19:56 -0000 1.27 +++ grep.1 23 Oct 2005 11:56:11 -0000 @@ -507,7 +507,7 @@ .PP Finally, certain named classes of characters are predefined within bracket expressions, as follows. -Their names are self explanatory, and they are +They are .BR [:alnum:] , .BR [:alpha:] , .BR [:blank:] , @@ -521,13 +521,10 @@ .BR [:upper:] , and .BR [:xdigit:]. -For example, -.B [[:alnum:]] -means -.BR [0\-9A\-Za\-z] , -except the latter form depends upon the C locale and the -\s-1ASCII\s0 character encoding, whereas the former is independent -of locale and character set. +Such a character class matches a character for which the corresponding +ctype(3) function (prefixed with +.BR is ) +returns a non-zero value. (Note that the brackets in these class names are part of the symbolic names, and must be included in addition to the brackets delimiting the bracket list.) Most metacharacters lose their special meaning --3V7upXqbjpZ4EhLz--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051023120218.GB576>