Internal implementation details of wreck. This is not part of the public API of wreck and is subject to change without notice.
Internal implementation details of wreck. This is not part of the public API of wreck and is subject to change without notice.
(flags re)Returns the flags for re as a String, or nil if re doesn't have any
or is not a regex.
Notes:
LITERAL and CANON_EQ) will be silently dropped. Use
[[has-non-embeddable-flags?]] if you need to check for this.Returns the flags for `re` as a `String`, or `nil` if `re` doesn't have any or is not a regex. Notes: * on the JVM, flags that don't have an embedded equivalent (as of JVM 25, `LITERAL` and `CANON_EQ`) will be silently dropped. Use [[has-non-embeddable-flags?]] if you need to check for this.
(raw-flags re)Returns the raw, platform specific flags in re. On the JVM this is an
int, on JavaScript this is a String. If re has no flags, or re is not
a regex, returns nil.
Returns the raw, platform specific flags in `re`. On the JVM this is an `int`, on JavaScript this is a `String`. If `re` has no flags, or `re` is not a regex, returns `nil`.
(raw-str o)clojure.core/str but with better support for JavaScript's appalling RegExp
class.
Note:
`clojure.core/str` but with better support for JavaScript's appalling RegExp class. Note: * Ignores all programmatic (non-embedded) flags in the regex.
(regex? o)Is o a regex?
Notes:
regexp? predicate in cljs.core, but
ClojureJVM doesn't. See this ask.clojure.org post.Is `o` a regex? Notes: * ClojureScript already has a `regexp?` predicate in `cljs.core`, but ClojureJVM doesn't. See [this ask.clojure.org post](https://ask.clojure.org/index.php/1127/add-clojure-core-pattern-predicate).
(set-flags re flgs)Sets the flags on re to flgs (a String, or nil to strip all flags),
returning a new regex. All existing flags in re are replaced. Returns
nil if re is nil. Throws if invalid flag characters are provided.
Sets the flags on `re` to `flgs` (a `String`, or `nil` to strip all flags), returning a new regex. All existing flags in `re` are replaced. Returns `nil` if `re` is `nil`. Throws if invalid flag characters are provided.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |