[Issue 20217] New: Regex literals don't escape double quotes
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 16 20:30:59 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20217
Issue ID: 20217
Summary: Regex literals don't escape double quotes
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: marksillweb at gmail.com
You can't create a regex literal that contains an escaped double quote in it.
Example:
import std.regex;
import std.stdio;
void main() {
auto re = regex(r"\""); // r`"` doesn't work either
writeln(re);
}
Errors:
source/app.d(4,16): Error: unterminated string constant starting at
source/app.d(4,16)
source/app.d(4,16): Error: Implicit string concatenation is deprecated, use
"\\" ~ "" instead
source/app.d(7,1): Error: semicolon expected following auto declaration, not
End of File
source/app.d(7,1): Error: found End of File when expecting } following compound
statement
--
More information about the Digitalmars-d-bugs
mailing list