Searching for a string in a text buffer with a regular expression

2013-12-06 Thread maxpat78
While porting a simple Python script to D, I found the following problem. I need to read in some thousand of little text files and search every one for a match with a given regular expression. Obviously, the program can't (and it should not) be certain about the encoding of each input file.

Re: Searching for a string in a text buffer with a regular expression

2013-12-09 Thread maxpat78
I mean a code fragment like this: foreach(i; 1..2085) { // Bugbug: when we read in the buffer, we can't know anything about its encoding... // But REGEX could fail if it contained unknown chars! Latin1String buf; string s;