Regular Expressions 101

Community Patterns

Extract AWS accountId from user arn

1

Regular Expression
ECMAScript (JavaScript)

/
^.*:(\d+):(root|(user\/.*))$
/
i

Description

Extract AWS accountId from user arn given by get-user action

Submitted by AlexanderC - 8 years ago