Test, validate and match regular expressions
This regex extracts file names and extensions from the end of URL paths. It uses alternation to handle two cases: files without extensions (captured in group 1) and files with extensions (filename in group 2, extension with dot in group 3). It's useful for processing URLs to identify downloadable resources, organize file uploads, or implement routing based on file types.