[Issue 245] New: Typo in Regexp article

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 7 01:20:30 PDT 2006


http://d.puremagic.com/issues/show_bug.cgi?id=245

           Summary: Typo in Regexp article
           Product: D
           Version: 0.158
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P5
         Component: www.digitalmars.com
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au


"To check for a match of a string s with a regular expression in Ruby, use the
~= operator,"
should be "use the =~ operator". (Ruby isn't D!)

And the example which says:

sub(s, "[ar]",
   delegate char[] (RegExp m)
   {
        return toupper(m.match(0));
   },
   "g");    // result: StRAp A Rocket engine on A chicken.

would be even more impressive with the new delegate syntax as:

sub(s, "[ar]",
   (RegExp m) { return toupper(m.match(0));  },
   "g");    // result: StRAp A Rocket engine on A chicken.

Optional: mention that toupper() comes from std.string.


-- 




More information about the Digitalmars-d-bugs mailing list