Create const regex?

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 6 07:32:28 PDT 2014


On Friday, 6 June 2014 at 12:01:55 UTC, AntonSotov wrote:
> const r1 = regex("bla");
> matchFirst( "big string", r1 );  //  ERROR!
>
> immutable r2 = regex("bla"); //  ERROR!
>
> Why can I not use const/immutable regex?

Not sure, but I suspect Regex has some internal state which is 
mutated during matching.


More information about the Digitalmars-d-learn mailing list