How to replace without overwriting
I've got a list of words I'm using for writing a game:
words[0 = 'INCREDIBLE' words[0 = 'SUPERB' words[0 = 'SUBLIME' words[0 = 'PHENOMENAL' words[0 = 'BLITZKRIEG' words[1 = 'EXCELLENT' words[1 = 'BOFFO' words[1 = 'SMASH' words[1 = 'SUPREME' words[1 = 'OUTSTANDING'
I want to make this into a 2d array by replacing the second '[' with ','
Obviously I can do this manually in no time at all. Nevertheless it's something I'd very much like to learn how to do with regex and notepad++. How would I identify the second '[' and then replace it without changing the adjoining numbers?
Currently I use \d+[\d+ to find it.
Just use this:
Find what: (\[\d+)\[ Replace with: $1,
If all or most [ are are in the same column, you can also use Alt to select the whole column via mouse and just enter ' to replace it in the whole marked range.
Try to replace (^words\[\d+)\[ by $1,
I used lookbehind (?<=\d)[
Lookahead and lookbehind are two very neat (and seemingly necessary) regex features.