regex fix

This commit is contained in:
olli 2023-10-27 12:08:04 +02:00
parent d36811c20c
commit 7b61b62fdb

View File

@ -2,7 +2,7 @@ function g_num_valid_number {
local f_num
for f_num in $@
do
if ! [[ ${f_num} =~ ^(-\.)?[0-9]+(\.[0-9]+)?$ ]]
if ! [[ ${f_num} =~ ^(-)?(\.)?[0-9]+(\.[0-9]+)?$ ]]
then
g_echo "\"${f_num}\": Not a valid number"
return 1