From 381d743ad9590c898091fa904fce732921f2bd98 Mon Sep 17 00:00:00 2001 From: parkervg Date: Tue, 30 Jul 2024 16:31:25 -0400 Subject: [PATCH] fix float regex --- blendsql/parse/_parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blendsql/parse/_parse.py b/blendsql/parse/_parse.py index 873c4eb7..c28c4861 100644 --- a/blendsql/parse/_parse.py +++ b/blendsql/parse/_parse.py @@ -402,7 +402,7 @@ def create_regex( # This is 20 digits long, so to be safe, cap the generation at 19 base_regex = r"((\d{1,18}" + f"|{DEFAULT_NAN_ANS}){DEFAULT_ANS_SEP})" elif output_type == "float": - base_regex = r"(((\d|\.)+" + f"|{DEFAULT_NAN_ANS}){DEFAULT_ANS_SEP})" + base_regex = r"((\d(\d|\.)*" + f"|{DEFAULT_NAN_ANS}){DEFAULT_ANS_SEP})" else: raise ValueError(f"Unknown output_type {output_type}") return lambda num_repeats: base_regex + "{" + str(num_repeats) + "}"