mAsterdam wrote:

They had to validate a date in a string with only a regular expression (and one only), due to environmental/tool contraints.

With all due respect, it's difficult to know how to answer this. What is their tool? Perl regular expressions tend to be much more expressive than most other language's regexen, so a direct conversion from a Perl regex to another language's regex may not be possible. If you just want comments on the Perl aspect, well, what you are doing is impressive, but it's the wrong tool for the job. If you want to know how you can use this for the other language, we can't answer that. Heck, for all I know, the other tool could use a DFA engine instead of an NFA engine, thus making a direct comparison very problematic.

Incidentally, judging from your email address and your username, I couldn't help but wonder if you have any association with the Hippies from Hell. If so, tell Willem Hengveld that "Curtis" says "hi" :) (I used to work with him)

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Re: Valid date in regex only by Ovid
in thread Valid date in regex only by mAsterdam

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.