Re: Text Suffix to Prefix Conversion

2007-04-19 Thread Peter Otten
7stud wrote: > On Apr 18, 11:08 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: >> EMC ROY wrote: >> > Original Sentence: An apple for you. >> > Present: An apple for you .<.> >> > Desire:An apple for you <.>. >> >>> text = 'An apple for you .<.>' >> >>> import re >> >>> re.sub

Re: Text Suffix to Prefix Conversion

2007-04-18 Thread 7stud
On Apr 18, 11:08 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > EMC ROY wrote: > > Original Sentence: An apple for you. > > Present: An apple for you .<.> > > Desire:An apple for you <.>. > >>> text = 'An apple for you .<.>' > >>> import re > >>> re.sub(r'(\S+)(<[^>]+>)(\s*)'

Re: Text Suffix to Prefix Conversion

2007-04-18 Thread Steven Bethard
EMC ROY wrote: > Original Sentence: An apple for you. > Present: An apple for you .<.> > Desire:An apple for you <.>. >>> text = 'An apple for you .<.>' >>> import re >>> re.sub(r'(\S+)(<[^>]+>)(\s*)', r'\2\1\3', text) 'An apple for you <.>.' -- http://mail.python.org/mailma