For example, to transform:
List(
User(1)
into:
UserQuery ++= List(
User(1)
where the User
is matched and used in forming UserQuery
.
I've had some difficulty getting newlines in regex to work with IntelliJ's Vim emulator (at the bottom of the editor window, after pressing and :
). There's no ^v like in ordinary Vim. :/
IntelliJ IDEA version: 14.1.3 (first time I've tried this in IntelliJ IDEA and so I don't know if this is a new issue.) Platform: Mac OS X 10.10.2 (Yosemite)
I've found the following to work.
To match: use \n
. To substitute in: use \r
.
That is, \n
doesn't work in substitution, \r
doesn't work in pattern. This regex works:
s/List(\n\( *\)\(\w*\)/\2Query ++= List(\r\1\2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With