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 ----------------------------------------------------------------------
In reply to Re^5: Regex to grab data after the work "branch from"
by Anonymous Monk
in thread Regex to grab data after the work "branch from"
by perl_mystery
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |