January 13, 2007 [Issue 835] New: RegExp.test wrongly matches strings on case insensitive attribute | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=835 Summary: RegExp.test wrongly matches strings on case insensitive attribute Product: D Version: 1.00 Platform: PC OS/Version: Windows Status: NEW Severity: major Priority: P3 Component: Phobos AssignedTo: bugzilla@digitalmars.com ReportedBy: tom_dlang@yahoo.com.ar The following code describes the problem. I've noted also that [] in the regexp is determinant for the bug to show. ------------------------------------------------------------------ import std.regexp; import std.stdio; int main() { auto str= "foo"; auto regex_str= r"fo[o]x"; auto regex= new RegExp(regex_str); auto regex_i= new RegExp(regex_str, "i"); writefln("'%s' matches '%s' ? ", str, regex_str, cast(bool) regex.test(str)); writefln("'%s' matches case insensitive '%s' ? ", str, regex_str, cast(bool) regex_i.test(str)); return 0; } ------------------------------------------------------------------- The output is: D:\src\d_tests>dmd -run bug_regexp.d 'foo' matches 'fo[o]x' ? false 'foo' matches case insensitive 'fo[o]x' ? true Regards, -- Tom; -- |
February 08, 2007 [Issue 835] RegExp.test wrongly matches strings on case insensitive attribute | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=835 tom_dlang@yahoo.com.ar changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from tom_dlang@yahoo.com.ar 2007-02-08 09:17 ------- Seems fixed in dmd 1.005. -- |
Copyright © 1999-2021 by the D Language Foundation