in reply to Re^4: Regex to grab data after the work "branch from"
in thread Regex to grab data after the work "branch from"

use YAPE::Regex::Explain; print YAPE::Regex::Explain->new( qr/branch\sfrom(.*\/(.*))\#\,(\#\d+)$/xms )->explain __END__ The regular expression: (?msx-i:branch\sfrom(.*/(.*))\#\,(\#\d+)$) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?msx-i: group, but do not capture (with ^ and $ matching start and end of line) (with . matching \n) (disregarding whitespace and comments) (case-sensitive): ---------------------------------------------------------------------- branch 'branch' ---------------------------------------------------------------------- \s whitespace (\n, \r, \t, \f, and " ") ---------------------------------------------------------------------- from 'from' ---------------------------------------------------------------------- ( group and capture to \1: ---------------------------------------------------------------------- .* any character (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- / '/' ---------------------------------------------------------------------- ( group and capture to \2: ---------------------------------------------------------------------- .* any character (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- ) end of \2 ---------------------------------------------------------------------- ) end of \1 ---------------------------------------------------------------------- \# '#' ---------------------------------------------------------------------- \, ',' ---------------------------------------------------------------------- ( group and capture to \3: ---------------------------------------------------------------------- \# '#' ---------------------------------------------------------------------- \d+ digits (0-9) (1 or more times (matching the most amount possible)) ---------------------------------------------------------------------- ) end of \3 ---------------------------------------------------------------------- $ before an optional \n, and the end of a "line" ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------

Replies are listed 'Best First'.
Re^6: Regex to grab data after the work "branch from"
by perl_mystery (Beadle) on Dec 14, 2010 at 09:10 UTC

    I did try this,couldnt find any thing,I will keep trying but incase if someone finds any fault please let me know