I created a sample script and used re 'debug',I really couldn't understand the output ...
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use re 'debug'; my $file= "//depot/asic/msmshared/users/QTVOEMDrops/7600/3555473R/qtv/ +player/audioplayer/audiocmx.cpp"; my $update_p4where=`p4 where $file`; #print "$update_p4where"; my $update_p4filelog=`p4 filelog $file`; print "$update_p4filelog\n"; my $update_base_branched_p4path = $update_p4filelog =~ /branch\sfrom(. +*\/(.*))\#\,(\#\d+)$/xmsg; print "$update_base_branched_p4path\n";

Compiling REx `branch from(.*/(.*))\#,(\#\d+)$' size 30 first at 1

1: EXACT <branchfrom>(5) 5: OPEN1(7) 7: STAR(9) 8: SANY(0) 9: EXACT </>(11) 11: OPEN2(13) 13: STAR(15) 14: SANY(0) 15: CLOSE2(17) 17: CLOSE1(19) 19: EXACT <#,>(21) 21: OPEN3(23) 23: EXACT <#>(25) 25: PLUS(27) 26: DIGIT(0) 27: CLOSE3(29) 29: MEOL(30) 30: END(0)

anchored `branch' at 0 floating `#,#' at 12..2147483647 (checking anchored) minlen 16

//depot/asic/msmshared/users/QTVOEMDrops/7600/3555473R/qtv/player/audioplayer/audiocmx.cpp ... #2 change 1548905 edit on 2010/12/09 by c_krisri@C_KRISRIXP (ktext) 'Audio loss when doing nultiple ' ... #1 change 1548876 branch on 2010/12/09 by c_krisri@C_KRISRIXP (ktext) 'Branching for orphan release fo' ... ... branch from //source/qcom/qct/multimedia/qtv/player/audioplayer/rel/1.1/src/audiocmx.cpp#1,#8

Guessing start of match, REx `branch\sfrom(.*/(.*))\#,(\#\d+)$' against `//depot/asic/msmshared/users/QTVOEMDrops/7600/3555473R/qtv/p...'...

Found anchored substr `branch' at offset 219... Contradicts floating substr `#,#', giving up...//Why is it giving up?why isn't it goint to the next line??

Match rejected by optimizer Freeing REx: `branch\sfrom(.*/(.*))\#,(\#\d+)$'


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.