standard unix regex uses the backslashed curly braces notation to indicate repeat ranges. perl regex doesn't use the backslashes. in other words use "m/A{3,4}/" in perl to match uppercase A, but only when it occurs 3 or 4 times consecutively.
Just a note about the way the question is posed, which i've seen a lot. Don't close yourself off from the possibility of a non-regex solution being a better fit for the problem. Parsing can be done in many ways, especially so in perl. unpack and closure functions come to mind as possibilities.
About the year in one of those fields being only two digits. in my opinion you should convert to four digit year, and maybe into a full date that's nicely later handled, e.g. 19700627. Making the transition early saves headaches later, if you're going to have to store the date in a DB or if you're ever going to have to calculate or even display it.
the hardest line to type correctly is: stty erase ^H
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.