public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix regex \w and \W handling
@ 2003-06-17 21:27 Jakub Jelinek
  2003-06-17 22:40 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2003-06-17 21:27 UTC (permalink / raw)
  To: Ulrich Drepper, Paolo Bonzini, Isamu Hasegawa; +Cc: Glibc hackers

Hi!

At least according to info sed, info grep and previous regex implementation,
\w should be [_[:alnum:]], not [_[:alpha:]] as current glibc regex uses.
Couldn't find a word about \w/\W in POSIX 2003 though.

Also, info sed mentions \s and \S to match any whitespace (or
non-whitespace), but apparently current sed does not handle it (as it uses
glibc regex). This might clash with \sCLASS and \SCLASS in emacs regexs
(support for them was in old glibc regex.c #ifdef emacs).

2003-06-17  Jakub Jelinek  <jakub@redhat.com>

	* posix/regcomp.c (build_word_op): Use alnum instead of alpha class.

--- libc/posix/regcomp.c.jj	2003-06-16 14:26:20.000000000 -0400
+++ libc/posix/regcomp.c	2003-06-17 16:39:27.000000000 -0400
@@ -3341,7 +3341,7 @@ build_word_op (dfa, trans, not, err)
 #ifdef RE_ENABLE_I18N
 			 mbcset, &alloc,
 #endif /* RE_ENABLE_I18N */
-			 (const unsigned char *) "alpha", 0);
+			 (const unsigned char *) "alnum", 0);
 
   if (BE (ret != REG_NOERROR, 0))
     {

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix regex \w and \W handling
  2003-06-17 21:27 [PATCH] Fix regex \w and \W handling Jakub Jelinek
@ 2003-06-17 22:40 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2003-06-17 22:40 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Paolo Bonzini, Isamu Hasegawa, Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakub Jelinek wrote:

> 2003-06-17  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* posix/regcomp.c (build_word_op): Use alnum instead of alpha class.

Applied.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+75hU2ijCOnn/RHQRAoqlAJ9QLnZ/RPxotqkMnk7+QgI/OtSayACfYUSO
kJRZQdGWnVhcYfVild8ZVH4=
=RjZ3
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-17 22:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-17 21:27 [PATCH] Fix regex \w and \W handling Jakub Jelinek
2003-06-17 22:40 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).