The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Browse by Tags

All Tags » RegExp » regex (RSS)
Sorry, but there are no more tags available to filter with.
  • Re: It works...

    zip: asuffield: zip: The fact that there's this much discussion about as simple a regex as "is it 6 numeric characters?" is why regexes are more trouble than they're worth at least half the time. If I can write code that does what the regex does in less than 60 seconds, there's no reason to use one....
    Posted to Forum by fennec on 04-26-2007
  • Re: It works...

    dhromed: If your regex engine does that, it depends on the flavour. :) Perl. In JS, /^\d{6}$/ will test for precisely six numeric characters, and not the newline. $ will test for the end of the string. It will return false on "123456\n", as the end of the string is not taken by a digit. When multiline...
    Posted to Forum by fennec on 04-26-2007
  • Re: It works...

    tster: AbbydonKrafts: Not too bad. It's a little overkill to instantiate a Regex object just for that. I would've stuck with a numeric and length check. probably because you have not mastered regexes. Otherwise you would have realized that "^\d{6}$" is much easier to write and maintain than however you...
    Posted to Forum by fennec on 04-25-2007
Page 1 of 1 (3 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems