Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp!
I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!
Start file
SarCastic
End file
[Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc]
View Diff
1c1 < SarCastic --- > [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc]
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 37 remaining solutions by signing in and submitting your own entry
#38 we’re going to need a bigger bot / @assaflavie - Score: 20 - 01/24/17 @ 22:40
:s/./[\u\0\l\0]/g<CR>ZZ
0 comments