I hate regular expressions!

    Date: 04/04/06 (PHP Community)    Keywords: php

    So we're trying to match a pattern (which we will then split)

    Expected format is tumb(with optional -d(## 1-20)-s(### 1-999))
    Examples of valid entries are

    tumb
    tumb-d2-n50
    tumb-d20-n369
    tumb-d20-n999
    tumb-d20
    tumb-d5-

    invalid example:
    tumb-d50-n1959


    After about an hour of me and another guy fighting php to amke this work, I've decided I hate php. :(

    We were either not matching at all, matching tumb-d20 as tumb-d2 with a 0 at the end.

    Anyone happen to be a regex master? :3

    Source: http://community.livejournal.com/php/433492.html

« cross posted to webdev... || Geeklog »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home