import std.regex; void main(){ assert(!match("", regex("^")).empty); } --- Using regex("^", "m") instead works correctly.
Seems to be an issue of ThompsonMatcher. --- assert(!bmatch("", regex("^")).empty); // passes ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/a5128eba77ac4818a5b67a541b95287a2af079d4 Merge pull request #455 from blackwhale/regex-fixes Fix issue 7111 - New regex engine cannot match beginning of empty string
*** Issue 7626 has been marked as a duplicate of this issue. ***