xxxxxxxxxx
import std.stdio;
import std.regex;
size_t findRegexBackward( dstring s, dstring needle )
{
auto m = matchFirst( s, regex( needle, "i") );
if ( m.empty )
return -1;
else
return m.pre.length;
}
void main()
{
//
}
unittest {
dstring s = "abc3abc7";
auto pos = findRegexBackward( s, r"abc"d );
writeln( pos );
}