[Top][All Lists]

[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: Gecko/20070530 Fedora/ Firefox/

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

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


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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