D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7111 - New regex engine cannot match beginning of empty string
Summary: New regex engine cannot match beginning of empty string
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
: 7626 (view as issue list)
Depends on:
Blocks:
 
Reported: 2011-12-14 12:36 UTC by Matt Peterson
Modified: 2012-03-02 14:52 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Matt Peterson 2011-12-14 12:36:15 UTC
import std.regex;

void main(){
    assert(!match("", regex("^")).empty);
}
---
Using regex("^", "m") instead works correctly.
Comment 1 Nils 2011-12-21 01:39:08 UTC
Seems to be an issue of ThompsonMatcher.
---
assert(!bmatch("", regex("^")).empty); // passes
---
Comment 2 github-bugzilla 2012-02-24 22:22:30 UTC
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
Comment 3 Nils 2012-03-02 14:52:52 UTC
*** Issue 7626 has been marked as a duplicate of this issue. ***