Line's number using regex in Notepad++?

notepad++, regex

Solution

Notepad++ can do that by using the TextFX plugin. Select the lines and then select `TextFX->TextFX Tools->Insert Line Numbers` from the menu bar.

This will add line-numbers padded to 8 places with leading zeros. To get them in the form described in your question, you can use a regex-replace with these values:

search for: `^0+([0-9]+)\s`

replace with: `line\1-`

Problem

Is it possible to get the line's number using regex in Notepad++; what I want to do, is replacing: ``` line1 line2 line3 etc.. ``` with ``` 1-line1 2-line2 3-line3 etc.. ```

Original source