(re-matches-ncg re s)
(re-matches-ncg re s ncgs)
Equivalent to clojure.core/re-matches, but instead of returning the match and sequence of groups, returns a (potentially empty) map of just the named-capturing groups in the regex if there was a match, or nil if the regex didn't match. Each key in the map is the String value of the name of that named-capturing group, and the corresponding value is a String containing the text that matched that group.
If the regex is being reused many times, the 3-arg version will be more efficient as it allows the caller to calculate the named-capturing groups in the regex once, then reuse that information, avoiding re-parsing of the regex on each call.
Equivalent to clojure.core/re-matches, but instead of returning the match and sequence of groups, returns a (potentially empty) map of just the named-capturing groups in the regex if there was a match, or nil if the regex didn't match. Each key in the map is the String value of the name of that named-capturing group, and the corresponding value is a String containing the text that matched that group. If the regex is being reused many times, the 3-arg version will be more efficient as it allows the caller to calculate the named-capturing groups in the regex once, then reuse that information, avoiding re-parsing of the regex on each call.
(re-named-groups re)
Returns the names of all of the named-capturing groups in the given regular expression as a set.
Note: JDK-agnostic workaround for https://bugs.openjdk.org/browse/JDK-7032377 (which is fixed in JDK 20)
Returns the names of all of the named-capturing groups in the given regular expression as a set. Note: JDK-agnostic workaround for https://bugs.openjdk.org/browse/JDK-7032377 (which is fixed in JDK 20)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close