Regular Expressions 101

Community Patterns

AWS EC2 Hostname

0

Regular Expression
PCRE2 (PHP >=7.3)

/
ec2-(?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2})(?:-(?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2})){3}\.(?:eu|us|af|ap|ca|me|sa)-(?:west|central|south|north|(?:south|north)?east)-[1-9]{1,1}\.compute\.amazonaws\.com
/
gm

Description

Validates AWS EC2 Hostnames

Submitted by holy-moly-555 - 2 years ago