I am new to clojure programming . I learn about line splitting by defining regular expressions. I study here https://clojuredocs.org/clojure.string/split
I want to break a string by specifying two regular expressions. For instance:
=> (require '[clojure.string :as str])
=> (str/split "Hello world! Have a nice day"
;; ["Hello" "world!" "Have" "a" "nice" "day"]
=> (str/split "Hello world!\nHave a nice day"
;; ["Hello world!" "Have a nice day"]
That's cool. Now I would like to split the line on each space and new line .
If the input is "Hello world! \ NChoose a good day . " The result should be ["Hello" "world!" "Have" "good" "day"]
Can anyone suggest me how I can do this? Thank you
source
share