Fork me on GitHub
#emacs
<
2020-07-17
>
Eric Ihli19:07:23

Given lines of

:ak1 {:abbr "ak" :name "Alaska"}
   :az {:abbr "az" :name "Arizona"}
   :ar {:abbr "ar" :name "Arkansas"}
   :ca {:abbr "ca" :name "California"}
   :co1 {:abbr "co" :name "Colorado"}
and wanting to replace the :[a-z]\{2,3\}\b with the respective line in the lines of
#uuid "8ce5e449-6699-4a57-b5ff-dcb1f3ac543d"
 #uuid "2058ed97-8cf2-4376-9979-33e13d3ce698"
 #uuid "20975100-6575-4cfe-b269-626ae379a78f"
 #uuid "59ad797e-e00a-4c39-9554-63c32126e4c0"
 #uuid "9243cc18-3395-416b-a0ea-d584f6f60e57"
how would you do it? Can't block select/replace since the columns needing replacement don't align. In this case, I could regex-replace the first column of the first line and make them match. But this is a contrived example driven by curiosity, not practicality, so just assume there is no block functionality.