This may seem like a silly question, but in D (using std.regex ), how do you match a literal dot in a string?
Using this code, I check the .bmp file extension, so I execute a simple regular expression on it. If I try to avoid a point like this, I get an error.
Regex!char Pattern = regex("\.bmp$", "i"); if (match(FileName, Pattern).empty) { FileName ~= ".bmp"; }
Error: Undefined escape sequence \.
Even in the documentation, he does not mention matching points.
Any ideas?
source share