simple "find" question

WhatMeWorry kc_heaser at yahoo.com
Mon May 7 12:45:35 PDT 2012


I get a comiler error for some older code which uses regexp.find

if (std.regexp.find(pText, lMacro.Pattern, "m") != -1)

Ok. So I look at the phobos docs and find:

deprecated sizediff_t find(string s, string pattern, string
attributes = null); Returns:

Same as find(s, RegExp(pattern, attributes)).

WARNING:
    This function is scheduled for deprecation due to unnecessary
ambiguity with the homonym function in std.string. Instead of
std.regexp.find(s, p, a), you may want to use find(s, RegExp(p,
a)).

But I can't find "find(s, RegExp(p, a))".  There is an entry in
std.algorithm but does a haystack and needle coorespond to a
string and regular expression.

And std.regex talks about "matches" and stuff but is this
equivalent to "find".


More information about the Digitalmars-d-learn mailing list