Replace and inserting strings within .txt files with the use of regex

Νίκος nikos.the.gr33k at
Mon Aug 9 21:27:56 CEST 2010

On 8 Αύγ, 20:29, John S <jstrick... at> wrote:

> When replacing text in an HTML document with re.sub, you want to use
> the re.S (singleline) option; otherwise your pattern won't match when
> the opening tag is on one line and the closing is on another.

Thats exactly the problem iam facing now with this statement.

src_data = re.sub( '<\?(.*?)\?>', '', src_data )

you mean i have to switch it like this?

src_data = re.S ( '<\?(.*?)\?>', '', src_data ) ?

More information about the Python-list mailing list