You can do the job in two steps:
- First step
- Move the cursor at the begining of the first line
- Select, in Edit menu, Edit in column mode (I'm not sure of the label, because I don't have an english version) you may type Alt+C
- In the pop-up window, choose the initial number and the increment then click OK
- Second step:
- Ctrl+H
- Find what:
(\d+)(.+?)\[\d+\]
- Replace with:
$2[$1]
- then click on Replace all
Regex explanation:
( : Start group 1
\d+ : 1 or more digits
) : End group 1
( : Start group 2
.+? : 1 or more any character except linebreak non greedy
) : End group 2
\[\d+\] : 1 or more digits enclosed in brackets
Replacement part:
$2 : Content of group 2 (ie. word before the opening braket: pig, chicken, ...)
[$1] : Content of group 1 (ie. the number generated in step 1), enclosed in brackets