This is really more of an IntelliJ question, but perhaps someone here has an idea about this, since it’s relevant in a Clojure context. In the interest of keeping lines short, I might sometimes break up a string literal in more than one line, eg.
"This is my
multiline string"
If I were to search for this in IntelliJ, I’d normally just use “Find in Path” (CMD F on Mac). However, if I typed this into the search field, I would find nothing: This is my multiline
. I’d have to turn regex on and search for This is my\s*multiline
. However, since I won’t know where line breaks are, I’d really have to search for This\s*is\s*my\s*multiline
.
This becomes really cumbersome really quick!
I wonder if there’s a way to assume or specify that each space in a search represents \s*
? Or some other, smart way to search for this type of literal?I don’t know any way to directly do what you want, but you could set up a Live Template that would make it easy to generate your search string in a REPL..
Cheers @manutter51, an extra weapon for the arsenal 🙂
:thumbsup:
(println (clojure.string/replace "Here is some test text." " " "\\s+"))
Here\s+is\s+some\s+test\s+text.
Not exactly what I’m looking for, but it’d be a help. How do I make it available to the REPL?
Once you define it you can use it in either the repl or the editor just by typing as[TAB]
where [TAB]
is the TAB key, of course.