From 3a9d442ccd3b61dce5c6cf21fd0720151bd3c012 Mon Sep 17 00:00:00 2001 From: Dexter Hoon Date: Tue, 14 Nov 2023 01:09:13 +0800 Subject: [PATCH] Edit ingredient qty regex for parseIngredient function --- src/main/java/seedu/cafectrl/parser/Parser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/cafectrl/parser/Parser.java b/src/main/java/seedu/cafectrl/parser/Parser.java index 7218a6ded..d0e501448 100644 --- a/src/main/java/seedu/cafectrl/parser/Parser.java +++ b/src/main/java/seedu/cafectrl/parser/Parser.java @@ -56,7 +56,7 @@ public class Parser implements ParserUtil { + "qty/\\s*(?.*)\\s*"; private static final String INGREDIENT_NAME_REGEX_GROUP_LABEL = "ingredientName"; private static final String INGREDIENT_QTY_REGEX_GROUP_LABEL = "ingredientQty"; - private static final String INGREDIENT_QTY_FORMAT_REGEX = "^\\s*(?[0-9]*)\\s*(?[a-zA-z]*)\\s*$"; + private static final String INGREDIENT_QTY_FORMAT_REGEX = "^\\s*(?[+-]*[0-9]*)\\s*(?[a-zA-z]*)\\s*$"; private static final String INGREDIENT_QTY_VALUE_REGEX_GROUP_LABEL = "value"; private static final String INGREDIENT_QTY_UNIT_REGEX_GROUP_LABEL = "unit"; private static final String ADD_DISH_NAME_ARGUMENT = "name/";