Test, validate and match regular expressions
This regex matches filenames that feature a base name, an underscore followed by digits, and a file extension, such as 'report_1.pdf' or 'image_02.jpg'. It captures the original filename into the first group and the file extension into the second. It is ideal for scripts that need to identify duplicate or versioned files, allowing you to easily extract the original name for cleanup or renaming tasks.