Ah, thank you (for your second point); that finaly clears it up. (All the other answers didn't parse the question as I meant it.)

As for the second part, since all these files have a name of the form a-z+-0-9+a-z0-9-*.jpg, so I just used a simple split /\./. (They're all jpegs now, but that might change; I wanted it to be at least a little more generic.) Your point is, of course, well taken, though there's probably a large problem space where you do know that there is an extention.

Thanks also to all the other people that had solutions to the $id.$ext problem as well; your answers were almost all enlightening.

I still wonder which is more efficent. I'll probably do some benchmarking at some later point.

Thanks,
James Mastros,
Just Another Perlmonks Neonate

In reply to Re: SOLUTION : Not so silly regex question by Anonymous Monk
in thread Probably silly regex question / not so silly regex question by theorbtwo

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.