Parentheses and regex : parentheses « Regular Expression « Perl






Parentheses and regex

   


#!/usr/bin/perl
use warnings;
use strict;

my $text= "Testing";
if ($text =~ /((T|N)est(ing|er))/) {
    print " \$1 = $1 \n \$2 = $2 \n \$3 = $3 \n \$4 = $4 \n";
}

   
    
    
  








Related examples in the same category

1.Using alternate with parentheses
2.Using alternate without parentheses