Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-10-10 06:45
Flavor·Python

r"
((?:(?:(?:[0-9a-fA-F]){1,4}):){1,4}:/[^\s:]\d{0,2})
"
gm
Open regex in editor

Description

This regexp is able to find ipv6 subnets in the compressed form (e.g: 2001:db8::/32). It doesn't perform any validation to the ipv6 addresses itself though.

Submitted by anonymous