OK, I'll step up to the plate...

Last week, in Reg Expression Question I was a bit rough on a newbie. The question was basically "How to I determine if X is a member of set Y?" (with an attempted solution using a regex) A bunch of us jumped on the question right after it was posted, in our haste azatoth posted an incorrect answer. Not a big deal, azatoths been around and can take it when several of us pointed out the mistake. However this set the stage for my mood in a later posting.....

Two good solutions were proposed, 1.) grep an array made from the set, or 2.) check for a hash key in a hash made from the set. A regex is ill suited for this task, which I thought this had been communicated in the thread. However, two hours later, a newbie pix used his second post ever to suggest using a regex. It happens to contain an overlooked 'gotcha' lurking within. I felt that anyone who read the previous posts should be able to conclude that regexes were not the way to go, so I shot down the suggestion with a bit more gusto than I should have. (I toned the node down significantly after the fact)

I hadn't realized that I was roasting someone's second post, and some of the mistakes earlier in the thread had been edited so it didn't read quite like I assumed it did. I'm concerned that my grumbling might have made pix a bit gunshy......

Anyway, pix if you're out there, sorry I roasted your second post. It actually was a rather clever way to address the problem, swapping the data and regex around. While I wouldn't recommend this technique over the others, it did have a "coolness" factor to it that I totally overlooked before. I didn't mean to blast a newbie, and was more harsh than necessary.

-Blake


In reply to Re: Confession Booth by blakem
in thread Confession Booth by crazyinsomniac

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, 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, 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.