Regex – Extract filename from path

Use Regex to extract path or filename

To extract path without filename, or extract only filename, there are many regex possible.

Surfing through the net I have found some interesting solution:

Extract path without filename

Extract only filename

Notice that this will work even on filename without any extension

Extract extension of filename