in reply to Re: Regexp to extract groups of numbers
in thread Regexp to extract groups of numbers
Of course, there are tons of ways to handle this problem. =)#!/usr/bin/perl ########################################### use warnings; use strict; my $test = "000000000000022102840002210284"; if ( $test =~ /^(\d{10})(\d{10})(\d{10})$/ ){ print "1 = $1\n2 = $2\n3 = $3\n"; } else { print STDERR "Bad 30-digit number!$/"; }
|
---|