in reply to Re^2: What's wrong with this regex
in thread What's wrong with this regex
my $string = '12.34.56.78 asdfasdfasdfasdfasdf'; my $numbers = shift @{[split ' ', $string]}; my @numbers = split '\.', $numbers; use Data::Dumper; print Dumper(@numbers) if $numbers =~ /^[\d.]+$/;
EDIT: Whoops, sorry moritz - I confess to only skimming your answer and didn't notice that you had already suggested using split. Apologies!
|
|---|