New submission from Rex Dwyer:
regex.findall(r'((brown)|(lazy)){1<=e<=3} ((dog)|(fox)){1<=e<=3}',
'The quick borwn fax jumped over the lzy hog',
regex.ENHANCEMATCH)
crashes interpreter.
regex.__version__ => 2.4.85
python version
'3.4.2 (v3.4.2:ab2c0
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'(?CA)(?=GCTG)'
I cannot get re.split to split on this pattern as perl 5 does.
--
components: Regular Expressions
messages: 230831
nosy
Rex Dwyer added the comment:
sorry if I wasn't clear.
s = 'ACGTCAGCTGAAAAGCTGACGTACGT
re.split(r'(?CA)(?=GCTG)',s)
expected output is:
acgtCA|GCTGaaacccCA|GCTGacgtacgt
- ['ACGTCA', 'GCTGAAAA', 'GCTGACGTACGT']
I would also be able to split a text on word boundaries:
re.split(r'\b