Regexp and Regex - fixing old source code
Daren Scot Wilson
darenw at darenscotwilson.com
Sat Jun 1 15:31:01 PDT 2013
I have some D2 source code resembling
if (auto m = std.regexp.search(text, "x") ) {
...
}
This gives "function std.regexp.search is deprecated". Not being
expert at regexes in any compile-to-metal language including D, I
hoped I could just change "regexp" to "regex" and be on my way.
Nope, apparently the new regex isn't pin-for-pin compatible with
the old regexp. It doesn't have search(). The compiler gives
"Error: undefined identifier module regex.search"
Not wanting to spend a gob of time learning regex, which I'm
unlikely to ever use in my normal work (or abnormal work), is
there something like a how-to cheat sheet for switching regexp
code to regex?
More information about the Digitalmars-d
mailing list