Vincent Fourmond / Joey (Martin) Schulze

Removed discussion of `[[:<:]]' and `[[:>:]]' since they do
not seem to be in the glibc implementation.
As per
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666


>   The regex.7.gz mentions that [[:>:]] and [[:<:]] are available to designate word boundaries.
> However, neither grep nor sed, which are build on the standard libc regcomp do recognise this syntax.
> Moreover, the small program here
>
> #include <regex.h>
> #include <sys/types.h>
> #include <iostream>
>
> using namespace std;
>
> int main()
> {
>   regex_t RE;
>   int err_code = regcomp(&RE, "[[:<:]]",
>              REG_EXTENDED);
>   char Buffer[100];
>   if(err_code) {
>     regerror(err_code, &RE, Buffer, 100);
>     cerr << "Error : " << Buffer << endl;
>   }
> }
>
>
> produces the following error message:
>
> Error : Invalid character class name
This commit is contained in:
Michael Kerrisk 2005-05-11 16:06:19 +00:00
parent 80ee1d97e1
commit bf6c69c999
1 changed files with 23 additions and 17 deletions

View File

@ -26,6 +26,10 @@
.\" I added an AUTHOR paragraph below - aeb.
.\"
.\" In the default nroff environment there is no dagger \(dg.
.\"
.\" 2005-05-11 Removed discussion of `[[:<:]]' and `[[:>:]]', which
.\" appear not to be in the glibc implementation of regcomp
.\"
.ie t .ds dg \(dg
.el .ds dg (!)
.TH REGEX 7 1994-02-07
@ -157,23 +161,25 @@ These stand for the character classes defined in
.BR wctype (3).
A locale may provide others.
A character class may not be used as an endpoint of a range.
.PP
There are two special cases\*(dg of bracket expressions:
the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at
the beginning and end of a word respectively.
A word is defined as a sequence of
word characters
which is neither preceded nor followed by
word characters.
A word character is an
.I alnum
character (as defined by
.BR wctype (3))
or an underscore.
This is an extension,
compatible with but not specified by POSIX 1003.2,
and should be used with
caution in software intended to be portable to other systems.
.\" As per http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295666
.\" The following does not seem to apply in the glibc implementation
.\" .PP
.\" There are two special cases\*(dg of bracket expressions:
.\" the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at
.\" the beginning and end of a word respectively.
.\" A word is defined as a sequence of
.\" word characters
.\" which is neither preceded nor followed by
.\" word characters.
.\" A word character is an
.\" .I alnum
.\" character (as defined by
.\" .BR wctype (3))
.\" or an underscore.
.\" This is an extension,
.\" compatible with but not specified by POSIX 1003.2,
.\" and should be used with
.\" caution in software intended to be portable to other systems.
.PP
In the event that an RE could match more than one substring of a given
string,