From bfd7eb2141a650ace5b1a181c94b69abf7033177 Mon Sep 17 00:00:00 2001 From: Oleksandr Yakushev Date: Fri, 27 Sep 2024 09:59:47 +0300 Subject: [PATCH] Use non-capturing match group in alphanumeric regex If the group is non-capturing, Clojure will not form match groups with `re-groups`. We only use this regex as a predicate and don't need those. --- src/honey/sql.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index c390feb..23326ea 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -272,7 +272,7 @@ * the whole entity is numeric (with optional underscores), or * the first character is alphabetic (or underscore) and the rest is alphanumeric (or underscore)." - #"^([0-9_]+|[A-Za-z_][A-Za-z0-9_]*)$") + #"^(?:[0-9_]+|[A-Za-z_][A-Za-z0-9_]*)$") (defn format-entity "Given a simple SQL entity (a keyword or symbol -- or string),