Skip to content

Commit

Permalink
Fix code scanning alert no. 13: Inefficient regular expression
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Priyankar Pal  <[email protected]>
  • Loading branch information
1 parent ee6d5fd commit 65786f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plays/calculator-by-tea/useCalcalulatorByTeaHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const useCalcalulatorByTeaHook = () => {
}

function onInputRecived(expression: string) {
if (expression.match(/^(?:[0-9]+[-+*/]?)*[0-9]*$/)) {
if (expression.match(/^(?:[0-9]+[-+*/])*[0-9]*$/)) {
setCalculationExpression(expression);
}
}
Expand Down

0 comments on commit 65786f8

Please sign in to comment.