This is what I have so far.my $x=" 1.2.3.4:12345 "; $x = $x.trim; $x~~s/(.*'.') .*/$0$(Q[0/24])/; say "<$x>";
<1.2.3.0/24>
It works. Is there a way to petty it up with ^ and $ ?
This is what I have so far.my $x=" 1.2.3.4:12345 "; $x = $x.trim; $x~~s/(.*'.') .*/$0$(Q[0/24])/; say "<$x>";
<1.2.3.0/24>
It works. Is there a way to petty it up with ^ and $ ?