diff --git a/grbl.cpp b/grbl.cpp index 1d9376b..b03d9c1 100644 --- a/grbl.cpp +++ b/grbl.cpp @@ -35,7 +35,7 @@ grbl::program::program(std::string filename) { load_from_file(std::move(filename)); } -static auto comment_re = std::regex(R"(\(([^)]*)\))"); +static auto comment_re = std::regex(R"(^\s*\(([^)]*)\)\s*$)"); static auto gcode_re = std::regex(R"(([a-zA-Z0-9\s.\-]+)\s*(;.*|\(([^)]*)\))?)"); bool grbl::program::load_from_stream(std::istream& in) {