Community Patterns

Community Library Entry

2

Regular Expression
Created·2016-08-15 13:31
Flavor·Python

r"
\[(?:[a-zA-Z0-9]{0,4}:?){1,8}\]|\[(?:[a-zA-Z0-9]{0,4}:?){1,4}(?:[0-9]{1,3}\.){3}[0-9]{1,3}\]
"
g
Open regex in editor

Description

It's too large to match with all which seems like an IPv6. It's not perfect, but it's detects more valid IPv6 than some others regex.

Submitted by Ajabep