Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
  2. or download this
    use warnings;
    
  3. or download this
    $str = s/.*\-D*?//;
    
  4. or download this
    $_ = "text1 text2 -f -DFLAG1 -global -DFLAG2 -DFLAG1";
    s/.*?(?=-D)//;
    print "$_\n";
    
  5. or download this
    s/[^-]+-[^-]+//;
    
  6. or download this
    s/
      [^-]+  # Negated character class - match one or more
    ...
      [^-]+  # Negated character class - match one or more
             # of anything that is not a dash: "f "
    //x;