[phobos] replaceAll undefined?

Steven Schveighoffer schveiguy at yahoo.com
Mon Apr 14 05:33:50 PDT 2014


On Apr 11, 2014, at 4:25 PM, Robert Hathaway <robert.of.santiago at gmail.com> wrote:

> Please excuse me, I'm a noob, but I am enjoying learning D.  I get the following compiler error:
> 
> testd2.d(7): Error: undefined identifier replaceAll
> 
> when trying to rdmd (build 20120724) the following file:
> 
> --------
> import std.stdio;
> import std.regex;
> 
> void main() {
>   // Comify a number
>   auto com = regex(r"(?<=\d)(?=(\d\d\d)+\b)","g");
>   assert(replaceAll("12000 + 42100 = 54100", com, ",") == "12,000 + 42,100 = 54,100");  // auto y = (m.captures[1].length > 0 ? m.captures[1] : (m.captures[2].length > 0 ? m.captures[2] : m.captures[3]));
> }
> --------
> 
> Can anyone tell me what's wrong?  The example is, by the way, taken straight from the online Phobos documentation.

The example works on dmd 2.065, both with dmd and rdmd.

With that version installed, rdmd says it's build 20140224. Looks like a date to me, and looks like you are using a July-2012 version!

Time to update :)

BTW, this list is for discussion of phobos development, and many people do not read this list. For further questions about D, please use the D.learn newsgroup. It also supports a web-based forum interface, as well as a mailing list interface. Please see forum.dlang.org.

-Steve


More information about the phobos mailing list