Regular Expressions 101

Community Patterns

AWS Arn matching

0

Regular Expression
Python

r"
^arn:(?P<Partition>[^:\n]*):(?P<Service>[^:\n]*):(?P<Region>[^:\n]*):(?P<AccountID>[^:\n]*):(?P<Ignore>(?P<ResourceType>[^:\/\n]*)[:\/])?(?P<Resource>.*)$
"
gm

Description

This pattern matches the AWS's ARN pattern

Submitted by anonymous - 3 years ago