in reply to Extract Sub String

Tip #9 from the Basic debugging checklist is to use YAPE::Regex::Explain to demystify Perl regular expressions:
The regular expression: (?-imsx:(.*?)"_RVCT") matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- ( group and capture to \1: ---------------------------------------------------------------------- .*? any character except \n (0 or more times (matching the least amount possible)) ---------------------------------------------------------------------- ) end of \1 ---------------------------------------------------------------------- "_RVCT" '"_RVCT"' ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------

Replies are listed 'Best First'.
Re^2: Extract Sub String
by gvinu4u (Acolyte) on Jun 22, 2011 at 10:50 UTC
    Thanks to all finally I got this working
    my ( $filename ) = $line =~ /(.*?)_RVCT/;