Цепочки regexов

May 08, 2015 14:50



sub ipv6squeeze ($) { $_[0] =~ s#(^|:)0+#$1#gr =~ s#:::+#::#gr }


# perl -le 'print sub { $_[0] =~ s#(^|:)0+#$1#gr =~ s#:::+#::#gr }->($ARGV[0])' \
2a01:00d0:ffff:0033:0000:0000:0000:0002
2a01:d0:ffff:33::2



perl, perl regexp

Previous post Next post
Up