Build, test, and debug regular expressions
This regex captures the main part of a string or file path by stripping trailing backslashes, asterisks, dots, and exclamation marks. It utilizes a lazy quant