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..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Notepad++ can do that by using the TextFX plugin. Select the lines and then select
TextFX->TextFX Tools->Insert Line Numbersfrom 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]+)\sreplace with:
line\1-