[New-bugs-announce] [issue3255] [proposal] alternative for re.sub

Hirokazu Yamamoto report at bugs.python.org
Wed Jul 2 10:43:13 CEST 2008


New submission from Hirokazu Yamamoto <ocean-city at users.sourceforge.net>:

I often do same mistake again and again. Most of re module's method
takes optional argument "flags" like this.

finditer( pattern, string[, flags]) 

But, sub() takes optional argument "count" not "flags".

sub( pattern, repl, string[, count]) 

So, when I write this code, it doesn't behave like what I want.

re.sub("<[^>]+>", "", content, re.S)

I think it would be nice if the method which takes optional argument
"flags" and do same behavior with re.compile(pattern[, flags]).sub(repl,
string). Thank you.

----------
components: Regular Expressions
messages: 69087
nosy: ocean-city
severity: normal
status: open
title: [proposal] alternative for re.sub
type: feature request

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3255>
_______________________________________


More information about the New-bugs-announce mailing list