chan-dx commented on code in PR #4229:
URL: https://github.com/apache/solr/pull/4229#discussion_r2969819393
##########
solr/core/src/java/org/apache/solr/schema/numericrange/AbstractNumericRangeField.java:
##########
@@ -82,9 +83,54 @@ public interface NumericRangeValue {
protected static final Pattern SINGLE_BOUND_PATTERN =
Pattern.compile("^" + COMMA_DELIMITED_NUMS + "$");
+ /**
+ * Regex fragment matching a comma-separated list of signed floating-point
numbers (integers or
+ * floating-point literals).
+ */
+ protected static final String COMMA_DELIMITED_FP_NUMS =
+ "-?\\d+(?:\\.\\d+)?(?:\\s*,\\s*-?\\d+(?:\\.\\d+)?)*";
+
+ private static final String FP_RANGE_PATTERN_STR =
Review Comment:
I noticed a small gap in the float validation regex: it doesn't accept
scientific notation. I tested `FP_RANGE_PATTERN_STR` pattern on regex101.com,
and an input like `[1.1 TO 1.5e10] `does not match.
Was the exclusion of scientific notation intentional? Or are values like
this expected to be rejected before reaching this validation step?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]