Making regular expressions more friendly

Fredrik Lundh fredrik at pythonware.com
Tue Oct 5 14:43:26 EDT 1999


Ian Clarke <clarkeia at logica.com> wrote:
> I have never liked regular expressions, they seem to come from the Perl
> school of programming (whose motto is "If nobody else `can understand my
> code, they can never fire me!").

> What if, instead of using '(hello)*' you could use 'multiple("hello")',
> and other such long-winded replacements.  Yes, this would prevent people
> from writing '(?P<m>\s*\d+/\d[-,\d]*/\d+,\s+[^,]+)(?P<u>.*' and then
> giggling with glee as their co-workers scratch their heads over what the
> hell this does, but that is a price I would be willing to pay.

check out ping's rxb.py module:

    http://www.lfw.org/python/

</F>

    "The only reason we keep our jobs is that we have done exactly
    what management has come to except: We commit to a schedule,
    work our butts off, miss the schedule, deliver junk, get chewed
    out, and iterate. They can fire us, but they can't replace us with
    anyone better, and they know it."
            -- Al Stevens, in Dr. Dobbs





More information about the Python-list mailing list