[phobos] std.regex

Chris Moller via phobos phobos at puremagic.com
Sun May 29 10:59:25 PDT 2016


Starting with the usual turn-off disclaimer, "I'm new to D..." Sorry, 
but I'm in hair-tearing mode.

I'm trying to compile part of the sample code from 
dlang.org/phobos/std_regex.html:

import std.regex;
import std.stdio;

void main()
{
   // Print out all possible dd/mm/yy(yy) dates found in user input.
   auto r = 
regex(r"\b[0-9][0-9]?/[0-9][0-9]?/[0-9][0-9](?:[0-9][0-9])?\b");
   foreach(line; stdin.byLine)
   {
     // matchAll() returns a range that can be iterated
     // to get all subsequent matches.
     foreach(c; matchAll(line, r))
       writeln(c.hit);
    }
}

What I'm getting is:

[0] (moller at qcore) >ldc2 -c re.d re.d
(13): Error: undefined identifier matchAll

[1] (moller at qcore) >ldc2 --version
LDC - the LLVM D compiler (0.12.0):
   based on DMD v2.063.2 and LLVM 3.3
   Default target: x86_64-redhat-linux-gnu
   Host CPU: core2
   http://dlang.org - http://wiki.dlang.org/LDC
   Registered Targets:
     aarch64 - AArch64
     arm - ARM
     cpp - C++ backend
     nvptx - NVIDIA PTX 32-bit
     nvptx64 - NVIDIA PTX 64-bit
     ppc32 - PowerPC 32
     ppc64 - PowerPC 64
     r600 - AMD GPUs HD2XXX-HD6XXX
     systemz - SystemZ
     thumb - Thumb
     x86 - 32-bit X86: Pentium-Pro and above
     x86-64 - 64-bit X86: EM64T and AMD64

[0] (moller at qcore) >uname -a
Linux qcore.mollernet.net 3.14.4-200.fc20.x86_64 #1 SMP Tue May 13 
13:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

 From /etc/dmd.conf:
DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import 
-L-L/usr/lib64 -L--export-dynamic


So, what am I doing wrong?

Thanks,
Chris Moller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20160529/6d8d0403/attachment.html>


More information about the phobos mailing list