Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #50747
| References | <CADiHtmufOLNysgOP7Qoh70_aT+r3rhKFS=9qgd_AcDNgEFVnqw@mail.gmail.com> <CAN1F8qUpxVuNV-9+9NT1zCzkXQKMMwMtTdCv0+TJ-P9wnigcjg@mail.gmail.com> <CADiHtmum9=otNTuFCwwzsmyKSq_4126D2AnpdWoXGBhEABZHow@mail.gmail.com> <51E568E6.4060103@mrabarnett.plus.com> |
|---|---|
| From | Joshua Landau <joshua@landau.ws> |
| Date | 2013-07-16 17:22 +0100 |
| Subject | Re: help on python regular expression named group |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4775.1373991785.3114.python-list@python.org> (permalink) |
On 16 July 2013 16:38, MRAB <python@mrabarnett.plus.com> wrote: > On 16/07/2013 11:18, Mohan L wrote: >> >> I using another third party python script. It takes the regex from >> configuration file. I can't write any code. I have to do all this in >> single regex. >> > A capture group captures a single substring. > > What you're asking is for it to with capture 2 substrings (the date and > the time) and then join them together, or capture 1 substring and then > remove part of it. > > I don't know of _any_ regex implementation that lets you do that. If MRAB is correct, there is one straw-clutching method. If in the configuration you pass a regex *object* rather than a regex string, you could duck-type as a regex object. This might sound far-fetched but it's happened once to me. Otherwise, good luck.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: help on python regular expression named group Joshua Landau <joshua@landau.ws> - 2013-07-16 17:22 +0100
csiph-web