Something's strange in the way you have used these regexes, A standard PDB file format does not look so much like the example you have mentioned, the data generated from PDB comes with ATOM or HETATM at the beginning of the line, then the atom position & type, going through again until the end of a line in an atom name again... you seem to have included a lot of brackets for backreferencing in your arrays, that is not really endorsed unless you really strictly have to, why don't you look for another way of reading these lines and putting a condition that enable you to select the lines you want printed and discard those you do not want instead of squeezing your brains this way!!!, however, try to show us an example of a couple of full PDB lines between the code tags, that can make us be able to have better visuals and get closer to understanding what you need to do.
Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind

In reply to Re: Help for a regex problem ? by biohisham
in thread Help for a regex problem ? by hellworld

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.