On Oct 2, 4:03 pm, [EMAIL PROTECTED] wrote:
>     Jason> With Perl I might do something like this:
>     Jason> $line =~ s/(select)/uc($1)/e;
>     ...
>     Jason> How would I do this with Python?
>
> I'm sure there are plenty of ways to skin this particular cat, but how is
> 's/.../.../e' different from 's/.../.../'?  (For those of us who are not
> Perl mongers.)
>
> Skip

The '/e' means that the replacement string is actually code to be
executed, the output of which becomes the replacement string.

Perl even allows '/ee' which executes the code, then takes the output
of that and executes it again. In fact, you can have an arbitrary
number of e's, which is very handy for crazy people.

-- Mark.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to