It could be that the string returned from the regex looks the same as the hardcoded string but contains characters that don't show up when you print it. Does adding assert(regexResult == expectedFilename); throw?
"Simen kjaeraas" <[email protected]> wrote in message news:[email protected]... >I have this weirdest bug. I'm extracting a list of files from a file, > using std.regex. Then, I try to open each of these, using > std.file.readText. This gives me this error: > > std.file.FileException: In std\file.d(198), data file data: The > filename, directory name, or volume label syntax is incorrect. > > Now, the funny thing is, the filename given (data) is wrong. The > filename extracted (and confirmed, by printing it) is data.ini. If I > hardcode the file name, no problem occurs. > > So, printing the filename confirms that the regex works, and > hardcoding it confirms that readText works. Nothing else does > anything to the filename. > > Does anyone have the slightest idea what might be wrong? > > -- > Simen
