#!/usr/bin/perl
$line="One two three four five";
if($line =~ m/(one)\s(two)\s(three)\s(four)\s(five)/i){
print "1: $1\n"; print "2: $2\n"; print "3: $3\n";
print "4: $4\n"; print "5: $5\n";
}#if
####
[me]$>perl -w regexp-test2.pl
1: One
2: two
3: three
4: four
5: five
####
#!/usr/bin/perl
$line="One two three four five";
if($line =~ m/(one)\s(two)\s(three)\s(four)\s(five)/i){
$one=$1;
$one =~ s/one/ONE/i;
print "1: $one\n";
print "2: $2\n";
print "3: $3\n";
print "4: $4\n";
print "5: $5\n";
}#if
####
[me]$>perl -w regexp-test3.pl
1: ONE
Use of uninitialized value $2 in concatenation (.) or string at regexp-test2.pl line 12.
2:
Use of uninitialized value $3 in concatenation (.) or string at regexp-test2.pl line 13.
3:
Use of uninitialized value $4 in concatenation (.) or string at regexp-test2.pl line 14.
4:
Use of uninitialized value $5 in concatenation (.) or string at regexp-test2.pl line 15.
5: