[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: Thanks Matthew. :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26354] re.I does not work as expected

2016-02-15 Thread Matthew Barnett
Matthew Barnett added the comment: The 3rd argument is the count (the maximum number of replacements, although 0 means no limit, not no replacements). You're passing in the flag re.I instead. re.I happens to have the numeric value 2, so you're telling it to do no more than 2 replacements.

[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: Corrected Message : If we compare the first example () and the example, I am using re.I as the third element. But for the example, still I am able to get the substitution happening correctly. Could you pls, let me know the reason of change in behaviour.

[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: :-) Thanks a lot Matthew for the inputs. If we compare the first example () and the example, I am using re.I as the third element. But for the example, still I am not to get the substitution happening correctly. Could you pls, let me know the reason of

[issue26354] re.I does not work as expected

2016-02-15 Thread Matthew Barnett
Matthew Barnett added the comment: The pattern '\', which is the same as '', matches the string '', and that is replaced with ''. -- ___ Python tracker

[issue26354] re.I does not work as expected

2016-02-15 Thread Magesh Kumar
Magesh Kumar added the comment: Thanks for the inputs, It would be of great help, if someone could help me in explaining the below output : >>> a 'ype="str">falseDefaultMulticastClient>> b = re.sub('\', '', a, re.I)

[issue26354] re.I does not work as expected

2016-02-12 Thread Magesh Kumar
New submission from Magesh Kumar: I am in the process of re.sub the tag with empty string from a xml output line. If "re.I" is used, I am not able to remove the complete tag. >>> a

[issue26354] re.I does not work as expected

2016-02-12 Thread Ezio Melotti
Ezio Melotti added the comment: See #11957 -- resolution: -> not a bug stage: -> resolved status: open -> closed superseder: -> re.sub confusion between count and flags args ___ Python tracker

[issue26354] re.I does not work as expected

2016-02-12 Thread Matthew Barnett
Matthew Barnett added the comment: The 4th argument of re.sub is the count, not the flags. Not a bug. -- ___ Python tracker ___