Regex index : Index « Regular Expression « Perl






Regex index

    


$text = "no and yes";

$text =~ s/(\w+) (\w+) (\w+)/$3 $2 $1/;

print $text;

   
    
    
    
  








Related examples in the same category

1.Back referencing
2.Backreferencing and greed
3.Backreferencing and greedy quantifiers
4.Match the first alphanumeric character
5.Matched index
6.$1 gets 'A', $2 gets' B'