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/324706.html below:

re.split() problem

re.split() problem re.split() problemMasayuki Takemura ICG04984 at nifty.com
Thu Sep 22 09:40:41 EDT 2005
Hi all. 

re.split() doesn't work as I intend.

My Python Version is  2.4.1
(#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32.

For example,

>>> r = re.compile('^$', re.MULTILINE)
>>> r.split('foo\nbar\n\nbaz')
['foo\nbar\n\nbaz']

but I expected ['foo\nbar\n', 'baz'].

This problem has been discussed following threads.

[ 852532 ] ^$ won't split on empty line
<http://sourceforge.net/tracker/index.php?func=detail&aid=852532&group_id=5470&atid=105470>

re.split on empty patterns
<http://thread.gmane.org/gmane.comp.python.devel/62231>

Will it be fixed in Python 2.4.2?

Regards,

--
Masayuki Takemura


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