Hi Monks

I postes in chatterbox but thought to post a more accurate picture of what I am trying to accomplish Thank you for your time

I am tryning to match in $record CPOSTA_1221170039_C1_F1 but it includes the whole path when it matches

This is what I match => 49\backup\rbgmst02_dd2\stu1\CPOSTA_1221170039_C1_F1

how do I get it not to include the \ and why does it match the \ for interest sake?

I have tried [^\\] but it then just does not match anything

$record = "FRAG 1 1 2000000 0 0 0 0 \\\\172.20.13.49\\backup\\rbgmst02 +_dd2\\stu1\\CPOSTA_1221170039_C1_F1 rbgmst02 65536 0 0 -1 0 *NULL* 12 +22379639 1 65537 0 0 0 0 0 0 0"; if($record =~ m|FRAG|) { if($record =~ m|([A-z0-9]+[_][0-9]+[_]C[0-9]+[_][A-z0-9]+)|) { #print $2."\n"; push(@netbck_list,$1); print $1."\n"; } #if($record =~ m|FRAG(.*?)\/([A-z0-9_-]+[_][0-9]+[_]C[0-9]+[_][A +-z0-9]+)|) else { #print "FRAG RECORD NOT MATCHED => $record \n"; } } #if($record =~ m|FRAG|)

In reply to Regular expression by PugSA

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.