while ($parse =~ s!(\d{1,2})/(\d{1,2})(?:-(\d{1,2}))?!!) { $end = $3 ? $3 : $2; print "untagged Interface GigabitEthernet $1/$_\n" for ($2 .. $end) }