skbio.sequence.GrammaredSequence.find_with_regex¶
- GrammaredSequence.find_with_regex(regex, ignore=None)[source]¶
Generate slices for patterns matched by a regular expression.
State: Stable as of 0.4.0.
- Parameters:
- Yields:
slice – Location where the regular expression matched.
Examples
>>> from skbio import Sequence >>> s = Sequence('AATATACCGGTTATAA') >>> for match in s.find_with_regex('(TATA+)'): ... match ... str(s[match]) slice(2, 6, None) 'TATA' slice(11, 16, None) 'TATAA'