(:replace-in) - Operators
replace region matched by a pattern
clojure
(:replace-in val sub?)Where:
Expanding into:
clojure
(:#replace region \1 \2)Guides
Behavior
- Similar to (:replace) only that it operates on a specific region and not the entire node.
Examples
Replace all instances of a deprecated API call with its modern equivalent.
clojure
(call (:replace-in /_sync$/ "Sync"))Selects in lines { 1 }:
typescript
readFile_sync()
readFile()Arguments
val
- inherit
sub
- String
Does NOT support: Composition — Free-form Selection — Refinement — Replacement