Елисова Анастасия, 517 группа IPv6Match 328
nastyaa IPv6Match 378
f1import ref1import re
22
t3def ipv6match(text: str):t3def ipv6match(s: str):
4    s = '(?:[0-9A-Fa-f]{1,4})'4    h16 = '[0-9A-Fa-f]{1,4}'
5    ipv6 = f'^(?:(?:{s}:){{7}}{s}|(?:{s}:){{1,7}}:|:(?:{s}:){{1,7}}|(?:{5    MAINREG = f'^(?:(?:{h16}:){{7}}{h16}|(?:{h16}:){{1,7}}:|(?:{h16}:){{
>s}:){{1,6}}:{s}|(?:{s}:){{1,5}}(?::{s}){{1,2}}|(?:{s}:){{1,4}}(?::{s}){{>1,6}}:{h16}|(?:{h16}:){{1,5}}(?::{h16}){{1,2}}|(?:{h16}:){{1,4}}(?::{h16
>1,3}}|(?:{s}:){{1,3}}(?::{s}){{1,4}}|(?:{s}:){{1,2}}(?::{s}){{1,5}}|{s}:>}){{1,3}}|(?:{h16}:){{1,3}}(?::{h16}){{1,4}}|(?:{h16}:){{1,2}}(?::{h16})
>(?::{s}){{1,6}}|(?::(?::[0-9A-Fa-f]{{1,4}}){{1,7}})|::)$'>{{1,5}}|{h16}:(?:(?::{h16}){{1,6}})|:(?:(?::{h16}){{1,7}}|:))$'
6    return re.match(ipv6, text)6    return re.match(MAINREG, s)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op