I have one situation there I need to remove the array index from file
[0] => https://demo.com/alabama/18-wheeler-towing
[1] => https://demo.com/alabama
[2] => https://demo.com/alabama/winston-county/18-wheeler-towing
[3] => https://demo.com/alabama/winston-county
[4] => https://demo.com/service/18-wheeler-towing-addison-al
[5] => https://demo.com/alabama/winston-county/addison
I have a file there there thousands of link but I need something like
https://demo.com/alabama/18-wheeler-towing
https://demo.com/alabama
https://demo.com/alabama/winston-county/18-wheeler-towing
https://demo.com/alabama/winston-county
https://demo.com/service/18-wheeler-towing-addison-al
https://demo.com/alabama/winston-county/addison
How can I remove this array index using any file editor like vs code
2
Answers
On Visual Studio Code you may use the multi cursor, add as many cursors you want in either direction and delete the indexes by pressing the backspace or delete key.
If the index of array may have more than 1 digit, you can do with Notepad++:
^.+?(?=https)
LEAVE EMPTY
. matches newline
Explanation:
Screenshot (before):
Screenshot (after):