Test, validate and match regular expressions
This regex matches Amazon Resource Names (ARNs) and captures each component into named groups: Partition, Service, Region, AccountID, ResourceType (optional), and Resource. It handles both resource types with a colon or slash separator and plain resource identifiers. Useful for validating and decomposing ARNs in AWS-related tooling, log analysis, or configuration parsing.