On Monday 09 August 2010, it occurred to Νίκος to exclaim: > On 9 Αύγ, 19:21, Peter Otten <__pete...@web.de> wrote: > > Νίκος wrote: > > > Please tell me that no matter what weird charhs has inside ic an still > > > open thosie fiels and make the neccessary replacements. > > > > Go back to 2.6 for the moment and defer learning about unicode until > > you're done with the conversion job. > > You are correct again! 3.2 caused the problem, i switched to 2.7 and > now i donyt have that problem anymore. File is openign okey! > > it ALMOST convert correctly! > > # replace tags > print ( 'replacing php tags and contents within' ) > src_data = re.sub( '<\?(.*?)\?>', '', src_data ) > > it only convert the first instance of php tages and not the rest? > But why?
http://docs.python.org/library/re.html#re.S You probably need to pass the re.DOTALL flag. -- http://mail.python.org/mailman/listinfo/python-list