[issue22817] re.split fails with lookahead/behind

2015-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: re.split() with the r'(? wont fix stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyt

[issue22817] re.split fails with lookahead/behind

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Previous attempts to solve this issue: issue852532, issue988761, issue3262. -- ___ Python tracker ___

[issue22817] re.split fails with lookahead/behind

2014-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is possible to change this behavior (see example patch). With this patch: >>> re.split(r'(?<=CA)(?=GCTG)', 'ACGTCAGCTGAAAAGCTGACGTACGT') ['ACGTCA', 'GCTGAAAA', 'GCTGACGTACGT'] >>> re.split(r'\b', "the quick, brown fox") ['', 'the', ' ', 'quick', ',

[issue22817] re.split fails with lookahead/behind

2014-11-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as one of existing issue about zero-length matches (issue1647489, issue10328). -- ___ Python tracker ___ _

[issue22817] re.split fails with lookahead/behind

2014-11-07 Thread Rex Dwyer
Rex Dwyer added the comment: sorry if I wasn't clear. s = 'ACGTCAGCTGAAAAGCTGACGTACGT re.split(r'(? ['ACGTCA', 'GCTGAAAA', 'GCTGACGTACGT'] I would also be able to split a text on word boundaries: re.split(r'\b', "the quick, brown fox") -> ['the', ' ', 'quick', ', ', 'brown', ' ', 'fox']

[issue22817] re.split fails with lookahead/behind

2014-11-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> re.split(r'(?<=CA)(?=GCTG)', 'CAGCTG') ['CAGCTG'] I think expected output is ['CA', 'GCTG']. -- nosy: +serhiy.storchaka ___ Python tracker __

[issue22817] re.split fails with lookahead/behind

2014-11-07 Thread Ezio Melotti
Ezio Melotti added the comment: Can you provide a sample DNA sequence (or part of it), the exact code you used, the output you got, and what you expected? -- ___ Python tracker

[issue22817] re.split fails with lookahead/behind

2014-11-07 Thread Rex Dwyer
New submission from Rex Dwyer: I would like to split a DNA sequence with a restriction enzyme. A description enzyme can be describe as, e.g. r'(? ___ ___ Python-bugs-list mailing l