I appreciate that you are trying, but you are still not making any sense. You are not using "code" tags enough in your posts, you are not giving us anything we can try to run ourselves to demonstrate your problem, and you keep confusing "slash" with "\".

I'll propose the following, which is based on code and data in the original post at the top of this thread. Please try this out, tell us whether it works for you, and if it doesn't (and you are still stumped about how to make it work), tell us exactly how it should work.

#!/usr/bin/perl use strict; use warnings; while (<DATA>) { print "$1\n" if ( m{^\*\s+(?:/\w+)+\s+(.+?)\s+} ); } __DATA__ * /vobs/bt_rel /usr/add-on/puccase_vob01/ccvob01/bt_rel.vbs public (re +plicated) * /scm /usr/add-on/puccase_vob01/ccvob01/scm.vbs public (replicated) * /v_dialermidtier /usr/addon/puccase_vob01/ccvob01/v_dialermidtier.vb +s public (replicated) * /v_dialer /usr/add-on/puccase_vob01/ccvob01/v_dialer.vbs public (rep +licated) * /vobs/UMTools /user/addon/puccase_vob01/ccvob01/UMtools.vbs replicat +ed)
The difference between that and the OP code is:

If you are just trying to get the third space-delimited token from each line of input, you could do this for each line, instead of the regex match:

print +(split /\s+/)[2]; # print third "word" of line
(updated to include "+" outside the parens -- thanks, naikonta!)

If the data shown above is not correct, show us the actual data (inside <code> tags, please). If the output is not what you want, show us exactly what you want (based on the correct input data, again using <code> tags).


In reply to Re^3: Problem in pattern matching with alternation by graff
in thread Problem in pattern matching with alternation by perladdict

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.