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.
This commit is contained in:
Oleksandr Yakushev 2024-09-27 09:59:47 +03:00
parent 803584dc7c
commit bfd7eb2141

View file

@ -272,7 +272,7 @@
* the whole entity is numeric (with optional underscores), or * the whole entity is numeric (with optional underscores), or
* the first character is alphabetic (or underscore) and the rest is * the first character is alphabetic (or underscore) and the rest is
alphanumeric (or underscore)." alphanumeric (or underscore)."
#"^([0-9_]+|[A-Za-z_][A-Za-z0-9_]*)$") #"^(?:[0-9_]+|[A-Za-z_][A-Za-z0-9_]*)$")
(defn format-entity (defn format-entity
"Given a simple SQL entity (a keyword or symbol -- or string), "Given a simple SQL entity (a keyword or symbol -- or string),