From 172106717d8dabd9c96d5f2daeae4c24cd8c0b1e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 30 Sep 2022 15:05:41 -0400 Subject: [PATCH] must match the entire string --- src/variable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/variable.cpp b/src/variable.cpp index 61e29f4186..1142c6b27b 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -389,7 +389,7 @@ void Variable::set(int narg, char **arg) // 3rd is filled on retrieval } else if (strcmp(arg[1],"format") == 0) { - constexpr char validfmt[] = "% ?-?[0-9]*\\.?[0-9]*[efgEFG]"; + constexpr char validfmt[] = "^% ?-?[0-9]*\\.?[0-9]*[efgEFG]$"; if (narg != 4) error->all(FLERR,"Illegal variable command: expected 4 arguments but found {}", narg); int ivar = find(arg[0]); if (ivar >= 0) {