fork download
  1. #!/usr/bin/perl
  2. # your code goes here
  3.  
  4. use strict;
  5.  
  6. my $str = 'Birla Sun Life Global Real Estate Fund - Retail Plan - Direct Plan - Growth Option\'; ';
  7. my $regex = qr/(\w+)\s+Plan(?!.*Plan)/p;
  8.  
  9. if ( $str =~ /$regex/g ) {
  10. print "$1";
  11. }
  12.  
Success #stdin #stdout 0s 6056KB
stdin
Standard input is empty
stdout
Direct