bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #6027] Fix '\s' when using single byte string


From: Stepan Kasal
Subject: [patch #6027] Fix '\s' when using single byte string
Date: Sat, 21 Jul 2007 14:38:26 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070530 Fedora/1.5.0.12-1.fc6 Firefox/1.5.0.12

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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]