in reply to Using Regexp::Common
So what are the numbers?
Whatever this -keep option is its whats messing you up
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd /; use Regexp::Common qw/ RE_num_real /; my $shine = '10,101,110.110101101'; { my $rereal = RE_num_real(-keep, -group=>3, -sep=>',', -base=>2); if( $shine =~ m{($rereal)} ){ dd( $1, $2, $3, $4, $5, $6, ); } } { my $rereal = RE_num_real(-group=>3, -sep=>',', -base=>2); if( $shine =~ m{($rereal)} ){ dd( $1, $2, $3, $4, $5, $6, ); } } { my $rereal = RE_num_real(-group=>3, -sep=>',', -base=>2, -keep); if( $shine =~ m{($rereal)} ){ dd( $1, $2, $3, $4, $5, $6, $7, $8, ); } } __END__ (10, 10, "", 10, 10, undef) ("10,101,110.110101101", undef, undef, undef, undef, undef) ( "10,101,110.110101101", "10,101,110.110101101", "", "10,101,110.110101101", "10,101,110", ".", 110101101, undef, )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Regexp::Common (-keep)
by tye (Sage) on Sep 19, 2015 at 16:41 UTC | |
|
Re^2: Using Regexp::Common
by justrajdeep (Novice) on Sep 19, 2015 at 13:34 UTC | |
by AnomalousMonk (Archbishop) on Sep 19, 2015 at 16:13 UTC | |
by AnomalousMonk (Archbishop) on Sep 19, 2015 at 22:36 UTC | |
by justrajdeep (Novice) on Sep 20, 2015 at 11:36 UTC |