Help for this page

Select Code to Download


  1. or download this
    $_ = "foo\n Oops";
    print /^(?=.{0,50}$).*foo/i ? "Matches!" : $_;
    
  2. or download this
    /(?=^.{0,50}\z).*foo/si
    
  3. or download this
    $str =~ s/(foo)/&do_stuff($str) if length $1 < 50; $1/e;