Test, validate and match regular expressions
This regular expression extracts filenames and their extensions from URLs or file paths. It captures the filename without the extension in a named group and handles URL fragments (#) and query parameters (?). It supports both forward and backward slashes in directory paths.