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!
In reply to Re^3: What's wrong with this regex
by Riales
in thread What's wrong with this regex
by bgu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |