-- Part 1: generic replacement --
You could give the following regular expression a try:
//.*/([^/]+\.(jpg|png))
To break it down:
- 2 forward slashes
- Followed by one or more characters (
.
matches anything, +
means 1 or more)
- Followed by a slash
- Followed by anything that is not a slash: the filename before the extension (
[^\]
means anything except of slash, +
once again means one or more).
- Followed by a dot (
\.
escapes the dot, so that is interpreted literally)
- Followed by jpg or png (
|
means OR)
Then just replace with whatever you like. If you use $1 in the replacement it will be replaced with the filename. So in your example SomeXML.XML/$1
would be replaced with SomeXML.XML/Fabric Grey.jpg
.

-- Part 2: replacing SomeXML.XML with the current filename --
Unfortunately putting in the filename can not be done in the same replace action. It has to be done for each file separately, but a macro can help speed it up. Note that the steps below include recording said macro, so it is vital they are executed exactly as described.
- Open the files in notepad++ (having executed the above replacements first).
- Click Macro -> Start Recording.
- Press ctrl+f to open the find window.
- Go the the replace-tab.
- In the find-box, but
SomeXML.XML
.
- Empty the replace with box.
- Click Edit -> Copy to Clipboard -> Current Filename to Clipboard.
- Press ctrl+v in the replace with box to paste the filename.
- Click Replace All (NOT in all opened documents).
- Close the replace-window.
- Click Macro -> Stop Recording.
- Now in every file where you want to do the replacements, press Ctrl+Shift+P to execute the recorded macro.
Not fully automated, but this should already make your life quite a bit easier.