note
bobf
<p>
<blockquote>I got stuck in the regex</blockquote>
</p>
<p>
I would suggest starting with CPAN rather than writing your own parser. [mod://Bio::Structure::IO], [mod://Chemistry::File::PDB], [mod://Chemistry::Mol] all look relevant, and there are likely several more. If you use an existing module to do the low-level work, you can focus on the real reason you are writing the code (i.e., it isn't because you want to parse a PDB file, it is because you want to do something with the contents of the file).
</p>
<p>
If you insist on rolling your own parser, look at [doc://unpack]. It is great for fixed-width data, and will likely be much faster and less buggy than any regex you assemble.
</p>
<p>
HTH
</p>
817108
817108