[boston-pig] Python syntax question

Chris Curvey ccurvey at gmail.com
Tue Jun 5 06:03:28 MDT 2007


nope, but you can do it with the "re" module..

import re

compiled_regexp = re.compile("sensitive", re.IGNORECASE)

print re.sub(compiled_regexp, "foobar", "I'm INSENSITIVE")

(should replace any flavor of "sensitive" with "foobar" -- in this case,
returning "I'm INfoobar")

On 6/5/07, Brook, Robert <Robert.Brook at electricinsurance.com> wrote:
>
>
>
> Does anyone know if there is a parameter I can set on the replace function
> that will do a case insensitive replace (old,new).
>
>
> Thanks in advance.
>
>
>
>    Robert Brook
>    Electric Insurance Company
>    75 Sam Fonzo Drive, Beverly, MA 01915
>    phone: 978.524.5374
>    fax: 978.236.5374
>    robert.brook at electricinsurance.com
>    http://www.electricinsurance.com
>
>
>
>
> _______________________________________________
> boston-pig mailing list
> boston-pig at wingware.com
> http://wingware.com/mailman/listinfo/boston-pig
>
>


-- 
I am often wrong, but I am never in doubt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/boston-pig/attachments/20070605/a6b4c812/attachment.html


More information about the boston-pig mailing list