regex simplified

This commit is contained in:
skilion 2015-09-25 21:39:18 +02:00
parent 7afae8fbb8
commit b4aeda818a

View file

@ -29,7 +29,7 @@ struct Config
private void load(string filename)
{
auto file = File(filename, "r");
auto r = regex("(?:^\\s*)(\\w+)(?:\\s*=\\s*\")(.*)(?:\"\\s*$)");
auto r = regex(`^\s*(\w+)\s*=\s*"(.*)"\s*$`);
foreach (line; file.byLine()) {
auto c = line.matchFirst(r);
if (!c.empty) {