Help for this page

Select Code to Download


  1. or download this
    # Captures all but the leading and trailing parens.
    ($file_name) = $string =~ /^\((.*)\)$/;
    
  2. or download this
    # Captures the filename from the middle of the string.
    # You might have incorrect results if parens are used in more than one
    + place.
    ($file_name) = $string =~ /\((.*)\)/;
    
  3. or download this
    # Removes the leading paren and the trailing paren in place.
    $string =~ s/^\(//;
    $string =~ s/\)$//;