sed to python: replace Q

Mel mwilson at the-wire.com
Tue May 6 11:04:20 EDT 2008


Raymond wrote:

> My other gripe is with the kludgy object-oriented regex functions.
> Couldn't these be better implemented in-line?  Why should I, as a coder,
> have to 're.compile()' when all the reference languages do this at compile
> time, from a much more straightforward and easy to read in-line
> function...

Because compile time doesn't do

    pattern = raw_input ("Pattern, please: ")
    saved_pattern = re.compile (pattern)

        Mel.




More information about the Python-list mailing list