www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 338] New: Wrong regular expression \s \S descripion

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=338

           Summary: Wrong regular expression \s \S descripion
           Product: D
           Version: 0.166
          Platform: PC
               URL: http://www.digitalmars.com/ctg/regular.html
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: aarti interia.pl


Regexp description on http://www.digitalmars.com/ctg/regular.html says that:

\s matches a space
\S matches any character but a space

It's definitely not true in case of phobos regexp's. I found it after
frustrating experience when trying to match only spaces and tabs but not 
\r and \n. It was not working as specs says - \r and \n was also matched!

Probably \s matches something like this: [\f\n\r\t\v\x85\p{Z}] - any
white-space character. What's more as I observed space character is taken
literally from regexp, so there is no need to have escape character for
space.

one of refs which I found on net: http://regexlib.com/cheatsheet.aspx


-- 
Sep 10 2006
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=338


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla digitalmars.com  2006-10-25 18:09 -------
Fixed documentation.


-- 
Oct 25 2006