Test, validate and match regular expressions
This regex matches a string containing forward slashes, capturing everything up to and including the final slash in the first capturing group. It is commonly used to extract a directory path or base URL from a full file path or web address. The remaining trailing characters represent the final path segment, such as a filename or document.