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?

Your question can be understood in several ways. Others have answered one of these. OTOH, if you just have two strings, out of which the shorter one is a regex, and you want to know whether it is included in the other string, then I suggest using std.string.find which doesn't seem to cause heap allocation, and is very fast.

Reply via email to