in reply to Simple REGEX Help
# Captures all but the leading and trailing parens. ($file_name) = $string =~ /^\((.*)\)$/;
# 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 =~ /\((.*)\)/;
# Removes the leading paren and the trailing paren in place. $string =~ s/^\(//; $string =~ s/\)$//;
By the way, there's no reason to capitalize "regexp".
|
|---|