Update of patch #6027 (project grep):
Status: None => Invalid
Assigned to: None => kasal
Open/Closed: Open => Closed
Summary: Fix '\s' when using single byte string => Fix 's'
when using single byte string
_______________________________________________________
Follow-up Comment #1:
Hello Flavio,
's' is equivalent to character class [:space:] in Perl regular expressions.
So it is valid only with the experimental "grep -P" (or pcregrep, if you have
it installed).
With "grep" (or "grep -E"), you have to use [:space:], e.g.,
"^[[:space:]]*root" in your example.
In POSIX, regular expression 's' is undefined, both as a BRE and ERE, see
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_03_02
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04_02
I believe that the traditional interpretation was that this regular
expression matched the character 's', which still happens in C locale.
(Your example proves that the traditional behaviour is broken for the
multibyte character sets. But we are in the fields of undefined behaviour
anyway...)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?6027>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/