must match the entire string

This commit is contained in:
Axel Kohlmeyer 2022-09-30 15:05:41 -04:00
parent 08acd321f1
commit 172106717d
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 1 additions and 1 deletions

View File

@ -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) {