New regex: Find?

Derek Parnell derek at psych.ward
Mon May 4 14:02:19 PDT 2009


On Mon, 04 May 2009 10:09:56 -0500, Andrei Alexandrescu wrote:

> dsimcha wrote:
>> Is there an *efficient* way to simply test whether a given string contains a
>> given regex in the new std.regex?  Using match() and testing for empty works,
>> but this apparently triggers a bunch of unnecessary heap allocation.  If not,
>> is this a universal enough feature to warrant an enhancement request?
> 
> If you only search once, there will be allocation. However, if you 
> search for the same regex several times there will be no extra 
> allocation so the cost will be amortized.

ranslation: No, there isn't "an *efficient* way".

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list