Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'mrab': 0.05; 'subject:group': 0.05; 'method.': 0.07; 'subject:help': 0.08; 'correct,': 0.09; 'python': 0.11; 'subject:expression': 0.16; 'subject:regular': 0.16; 'substring': 0.16; 'subject:python': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'code.': 0.18; '(the': 0.22; 'otherwise,': 0.22; 'lets': 0.24; 'script.': 0.24; 'string,': 0.24; 'file.': 0.24; 'pass': 0.26; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; 'object.': 0.31; 'another': 0.32; 'to:name :python-list': 0.33; 'third': 0.33; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'to:addr :python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'remove': 0.60; "you're": 0.61; 'july': 0.63; 'sound': 0.68; 'captures': 0.84; 'substrings': 0.84; 'together,': 0.84; 'capture': 0.91; 'time)': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=E0DlKFt9S4dv1uBcEo5O5we190JVwpEvHYgj8tCAOx4=; b=C6/s5uHfDd4R+aRALXBhGevIznys2bP3GFugo6QPlR/IyQyb+PNBqWkHGMBKeZeRDJ 4ctjJoQwm202wGRtOBoy43WTT8pFK5QYD4bZqesl8/jEh4+awW8E9hppsCFAw6MrLWYa fr76kMIIv0YF/cluDtyPs71+u+Z3aET3156um2N9Hwdf8/160ojSokj+itrCddAbdFn0 c2tI5p2wvt97+E31ka/9dWreXyObSyNadcfYFoEBcATFO0pz94Bpvc7dZuHdwexcOllt f+pS2xSPb1xQye19NGXfabb5WXv/4q5wZBWKD0gA3FYJWEKdVnDpQkegx6TWL5v5LVEi Sipw== X-Received: by 10.152.121.73 with SMTP id li9mr1081523lab.42.1373991777137; Tue, 16 Jul 2013 09:22:57 -0700 (PDT) MIME-Version: 1.0 Sender: joshua.landau.ws@gmail.com In-Reply-To: <51E568E6.4060103@mrabarnett.plus.com> References: <51E568E6.4060103@mrabarnett.plus.com> From: Joshua Landau Date: Tue, 16 Jul 2013 17:22:17 +0100 X-Google-Sender-Auth: UaFh-vHBQ-QPixKAqx91aXBh6Yw Subject: Re: help on python regular expression named group To: python-list Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373991785 news.xs4all.nl 15985 [2001:888:2000:d::a6]:47595 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50747 On 16 July 2013 16:38, MRAB 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.