Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    prints:
    wanted="only text I want"
    wanted2="START only text I want END"
    
  2. or download this
    my ($x,$y) = ($text =~ /.*(START (.*) END)$/)[0,1];
    print "x=$x y=$y\n";
    #prints: x=START only text I want END y=only text I want