Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15536] re.split doesn't respect MULTILINE

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 2, 2012, 7:41 AM

Post #1 of 3 (50 views)
Permalink
[issue15536] re.split doesn't respect MULTILINE

New submission from Dave Abrahams:

This session demonstrates. See especially the very last expression evaluated

>>> s='''this is the end
s='''this is the end
... your only friend
your only friend
... the end'''
the end'''
>>> re.split('^', s, re.MULTILINE)
re.split('^', s, re.MULTILINE)
['this is the end\nyour only friend\nthe end']
>>> re.split('t', s, re.MULTILINE)
re.split('t', s, re.MULTILINE)
['', 'his is ', 'he end\nyour only friend\n', 'he end']
>>> re.split('\n', s, re.MULTILINE)
re.split('\n', s, re.MULTILINE)
['this is the end', 'your only friend', 'the end']
>>> re.split('(?<=\n)', s, re.MULTILINE)
re.split('(?<=\n)', s, re.MULTILINE)
['this is the end\nyour only friend\nthe end']
>>> re.split('^y', s, re.MULTILINE)
re.split('^y', s, re.MULTILINE)
['this is the end\nyour only friend\nthe end']
>>> re.split('$', s, re.MULTILINE)
re.split('$', s, re.MULTILINE)
['this is the end\nyour only friend\nthe end']
>>> re.split('$\n', s, re.MULTILINE)
re.split('$\n', s, re.MULTILINE)
['this is the end\nyour only friend\nthe end']
>>> re.split('\n', s, re.MULTILINE)
re.split('\n', s, re.MULTILINE)
['this is the end', 'your only friend', 'the end']
>>> re.split('^t', s, re.MULTILINE)
re.split('^t', s, re.MULTILINE)
['', 'his is the end\nyour only friend\nthe end']
>>> re.split('^t', s)
re.split('^t', s)
['', 'his is the end\nyour only friend\nthe end']
>>>

----------
components: Regular Expressions
messages: 167224
nosy: dabrahams, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.split doesn't respect MULTILINE
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15536>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 2, 2012, 10:06 AM

Post #2 of 3 (45 views)
Permalink
[issue15536] re.split doesn't respect MULTILINE [In reply to]

Serhiy Storchaka added the comment:

Same as for issue 15537.

----------
nosy: +storchaka

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15536>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 4, 2012, 2:07 PM

Post #3 of 3 (45 views)
Permalink
[issue15536] re.split doesn't respect MULTILINE [In reply to]

Changes by R. David Murray <rdmurray [at] bitdance>:


----------
resolution: -> duplicate
stage: -> committed/rejected
status: open -> closed
superseder: -> MULTILINE confuses re.split

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15536>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.