Help for this page

Select Code to Download


  1. or download this
    my $string = 'Hello sailor';
    my $regex = 'Hello (.*)';
    ...
    
    $string =~ s/$regex/$substitution/ee;
    print "string is now <$string> \n";
    
  2. or download this
    /usr/bin/perl -w /tmp/regex.pl 
    string is now <Goodbye sailor>