Bug 338 – Wrong regular expression \s \S descripion

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-09-10T11:47:00Z
Last change time
2014-02-15T13:29:08Z
Assigned to
bugzilla
Creator
aarti

Comments

Comment #0 by aarti — 2006-09-10T11:47:09Z
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
Comment #1 by bugzilla — 2006-10-25T18:09:01Z
Fixed documentation.