There will be hundreds, Thanks though.

Then you have to specify more precisely what is the rule for matching a line and not the other. The !/^9/ regex given by 2teez meets perfectly the incomplete requirement you gave: it does not match the first line and does match the two others. An example is always vary useful for comprehension and illustration, but it is not a substitute for a functional rule explaining exactly what you need. May be changing 2teez's general code to something more specific such as !/^9759/ will do the trick, but it might now be too specific, how shall we know if you don't tell us? Please detail your requirement.

Just a side question: you mention PCRE in the title of your post. Perl is certainly not using PCRE, since PCRE is basically a library to make Perl's internal regexes available functionalities similar to Perl's internal regexes available to languages other than Perl. Does that mean that you are using another language? I personally don't particularly care, but if such is the case, it means that we can offer you only pure regexes, not Perl code snippets.

Update: Following an Anonymous Monk's comment just below, slightly modified my sentence above in order not to give the impression that PCRE is identical to Perl's internal regexes, it has quite similar functionalities, but it is clearly not the same thing.


In reply to Re^3: PCRE help with negative match by Laurent_R
in thread PCRE help with negative match by Oolankaloophid

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.