Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
which will print 2001020713use strict; use warnings; my $data = 'abcd 2001020713'; my @nums = $data =~ /\d+/g; print "$nums[0]\n";
which will print 1use strict; use warnings; my $data = 'abcd 2001020713'; my $number = $data =~ /\d+/g; print "$number\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex question
by betterworld (Curate) on Oct 14, 2008 at 09:48 UTC | |
by chromatic (Archbishop) on Oct 14, 2008 at 18:22 UTC | |
by betterworld (Curate) on Oct 18, 2008 at 11:38 UTC | |
by JavaFan (Canon) on Oct 14, 2008 at 10:41 UTC | |
by betterworld (Curate) on Oct 14, 2008 at 10:55 UTC |