Liking cljdoc? Tell your friends :D
Clojure only.

clojurewerkz.support.re


re-gsubclj

(re-gsub regex replacement string)

Replaces all instances of 'pattern' in 'string' with 'replacement'. Like Ruby's 'String#gsub'.

If (ifn? replacment) is true, the replacement is called with the match.

Originally from clojure.contrib.str-utils

Replaces all instances of 'pattern' in 'string' with
'replacement'. Like Ruby's 'String#gsub'.

If (ifn? replacment) is true, the replacement is called with the
match.

Originally from clojure.contrib.str-utils
sourceraw docstring

re-partitionclj

(re-partition re string)

Splits the string into a lazy sequence of substrings, alternating between substrings that match the patthern and the substrings between the matches. The sequence always starts with the substring before the first match, or an empty string if the beginning of the string matches.

Originally from clojure.contrib.str-utils

Example:

(re-partition #"[a-z]+" "abc123def") ;= ("" "abc" "123" "def")

Splits the string into a lazy sequence of substrings, alternating
between substrings that match the patthern and the substrings
between the matches.  The sequence always starts with the substring
before the first match, or an empty string if the beginning of the
string matches.

Originally from clojure.contrib.str-utils

Example:

(re-partition #"[a-z]+" "abc123def")
;= ("" "abc" "123" "def")
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close