Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #64353
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <srikrishnamohan@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.042 |
| X-Spam-Evidence | '*H*': 0.92; '*S*': 0.00; 'patterns': 0.04; 'matches': 0.07; 'sub': 0.09; 'of\xa0': 0.16; 'followed': 0.16; 'trying': 0.19; 'skip:p 40': 0.19; '>>>': 0.22; 'example': 0.22; '>>>': 0.24; 'order.': 0.26; 'message- id:@mail.gmail.com': 0.30; 'know.': 0.32; 'thanks!': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'sequence': 0.36; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'times': 0.62; 'occur': 0.65; 'skip:r 30': 0.69; 'by\xa0': 0.84; 'krishna': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=iVrMPlbWZklUxuyQ1vJKg4RJVUngt5nlViVOIVyt8Fk=; b=X3P8xVdPHMLAbS3XXx7hR+wGE0n6uR+LLBhRSFs2vtIBd8QZ14PtyDvDSUIpF3oJdJ kh5kMQ4g1k4fM7YC1VkF4+IBWWPe33xMVbzI86fsFNhrt41iPIprniVgDYvH5EeDyi7n cLzEWqGWroTz3hklz5WujNT8sPzp0pk/h3XAFv0A9hM8NU5k2dzBQz40j6ED1ePL6A5F o9K8ncR8tZLikUsN5JyjjM5ZoMjdgcOV2gdw8H1JstccYg8zH2FEH2St83g84ELWH/DB zEbHEP3I1NPaCv2OHvj2I18VPW60t9a6HLbdqlgS+OZr6CW7AA342HL49RMl0MZ/bPZE rnGg== |
| MIME-Version | 1.0 |
| X-Received | by 10.229.105.9 with SMTP id r9mr26631757qco.12.1390214658536; Mon, 20 Jan 2014 02:44:18 -0800 (PST) |
| Date | Mon, 20 Jan 2014 16:14:18 +0530 |
| Subject | regex multiple patterns in order |
| From | km <srikrishnamohan@gmail.com> |
| To | python-list@python.org |
| Content-Type | multipart/alternative; boundary=001a113382b4e23b6104f064929b |
| X-Mailman-Approved-At | Mon, 20 Jan 2014 11:53:39 +0100 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5745.1390215221.18130.python-list@python.org> (permalink) |
| Lines | 43 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1390215221 news.xs4all.nl 2940 [2001:888:2000:d::a6]:54892 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:64353 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
I am trying to find sub sequence patterns but constrained by the order in
which they occur
For example
>>> p = re.compile('(CAA)+?(TCT)+?(TA)+?')
>>> p.findall('CAACAACAATCTTCTTCTTCTTATATA')
[('CAA', 'TCT', 'TA')]
But I instead find only one instance of the CAA/TCT/TA in that order.
How can I get 3 matches of CAA, followed by four matches of TCT followed
by 2 matches of TA ?
Well these patterns (CAA/TCT/TA) can occur any number of times and atleast
once so I have to use + in the regex.
Please let me know.
Thanks!
Regards,
Krishna mohan
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
regex multiple patterns in order km <srikrishnamohan@gmail.com> - 2014-01-20 16:14 +0530
csiph-web