Remove the last part of every line in notepad++

If we have the lines:

and we want final lines become like this:

we can applied notepad++ to do it. The solution as follow:

1) Using notepad++ and go to the search. Please used the regular expression as search mode

2) search


index\ means search for word; .* means everything else; $ means the end of line.

3) then replace with


4) That should find everything after (and including) index.php, and replace it with just index.php.


About zulkarnainh

I was born in Melaka (1987), holds the degree in B.Eng.(2010), M.Eng (2012) and Ph.D. (2016) in Civil Engineering at Universiti Teknologi Malaysia. I have been the UniMAP since 2016 and currently serving as Senior Lecturer. Feel free to contact me if you are interested to collaborate or pursuit a study (Master or Ph.D.) with me. Thank you!
This entry was posted in Code and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *