Re: help on python regular expression named group

Discussion in 'Python' started by Joshua Landau, Jul 16, 2013.

  1. 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.
     
    Joshua Landau, Jul 16, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VSK
    Replies:
    2
    Views:
    2,354
  2. Mohan L
    Replies:
    3
    Views:
    93
  3. Joshua Landau
    Replies:
    0
    Views:
    89
    Joshua Landau
    Jul 16, 2013
  4. Mohan L
    Replies:
    0
    Views:
    89
    Mohan L
    Jul 16, 2013
  5. MRAB
    Replies:
    0
    Views:
    89
Loading...

Share This Page