Skip to content

clojure.core/re-matcher

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 2 Runnable: 0
([re s])

Returns an instance of java.util.regex.Matcher, for use, e.g. in re-find.

Examples

by dakrone on . May have evaluation errors.
by cloojure on . May have evaluation errors.

Note by r4um

17:44 < mearnsh> tsdh: re-matcher should be avoided because the Matcher object it returns mutates in a non-thread-safe way

Note by timmc

It's fine to use from a controlled context. For instance, if you have a let that creates a Matcher, pulls out groups, and returns the data, you're working in a single-threaded context and the mutable object never even escapes.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.