1

I would like to add a letter before the last \ in each line in Notepad++, like this:

before :

product\190\1017\evita-cover-art.jpg

after :

product\190\1017b\evita-cover-art.jpg

So the letter b is added before the last \ ,

There are many lines, so I would use find and replace with regex probably.

Toto
  • 83,193
  • 59
  • 77
  • 109
  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Also, refer to [Learning Regular Expressions](https://stackoverflow.com/questions/4736) post for some basic regex info. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Jun 03 '20 at 18:01

1 Answers1

0
  • Ctrl+H
  • Find what: \\[^\\]*$
  • Replace with: b$0
  • CHECK Wrap around
  • CHECK Regular expression
  • Replace all

Explanation:

\\          # a backslash
[^\\]*      # 0 or more any character that is not a backslash
$           # end of line

Replacement:

b           # literally
$0          # content of group 0 (i.e. the whole match)

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here

Toto
  • 83,193
  • 59
  • 77
  • 109