A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/326294.html below:

re and escape character

re and escape characterSinan Nalkaya erchamion.beren at gmail.com
Fri Sep 16 03:03:14 EDT 2005
Thomas Guettler wrote:

>Am Thu, 15 Sep 2005 14:36:38 +0300 schrieb Sinan Nalkaya:
>
>  
>
>>i re-format incoming messages like this,
>>command = re.findall("^\002(.{2})\|.*\003$", response)[0]
>>it works well but when response comes with escape characters , my 
>>command variable crashes,
>>i cannot parse if response variable is like ,
>>response = '\002AB|TIasdasdasd
>>asdasdasd
>>xzczxc
>>qwewer
>>werwer|\003'
>>
>>ps:there must be \002 at the start and \003 at the end.
>>thanks.
>>    
>>
>
>Hi,
>
>I don't know what you mean with "escape characters".
>The dot does not match a newline. You  have to use the
>re.DOTALL option if you want this.
>
> HTH,
>   Thomas
>
>  
>
thats exactly what i want, how can i use DOTALL, by doing re.compile ?
thanks

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4