What's the right way to test if regex.match() hits or not?

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Jun 2 07:06:38 PDT 2009


On Tue, Jun 2, 2009 at 12:16 AM, Russell Lewis
<webmaster at villagersonline.com> wrote:

>
> P.S. Does anybody know why dmd complains "cannot evaluate at compile time"
> when I set those regex objects to "static invariant" so I'm not rebuilding
> them with every pass?
>

Because it wants you to have a constant expression to initialize a
static variable, and so it tries to evaluate regex(...) at compile
time.  You know, there's a much easier way to prevent them from being
reinitialized every iteration - move their declaration above the loop.


More information about the Digitalmars-d-learn mailing list