look-behind fixed width issue (package re)

Discussion in 'Python' started by Peng Yu, Oct 24, 2008.

  1. Peng Yu

    Peng Yu Guest

    Hi,

    It seem that the current python requires fixed-width pattern for look-
    behind. I'm wondering if there is any newly development which make
    variable-width pattern available for look-behind.

    Thanks,
    Peng
     
    Peng Yu, Oct 24, 2008
    #1
    1. Advertising

  2. Peng Yu

    MRAB Guest

    On Oct 24, 6:29 am, Peng Yu <> wrote:
    > Hi,
    >
    > It seem that the current python requires fixed-width pattern for look-
    > behind. I'm wondering if there is any newly development which make
    > variable-width pattern available for look-behind.
    >

    The re module is currently being worked on, but unfortunately it won't
    appear until Python 2.7. Variable-width look-behind is one of the
    improvements.
     
    MRAB, Oct 24, 2008
    #2
    1. Advertising

  3. MRAB wrote:
    > On Oct 24, 6:29 am, Peng Yu <> wrote:
    >> Hi,
    >>
    >> It seem that the current python requires fixed-width pattern for look-
    >> behind. I'm wondering if there is any newly development which make
    >> variable-width pattern available for look-behind.
    >>

    > The re module is currently being worked on, but unfortunately it won't
    > appear until Python 2.7. Variable-width look-behind is one of the
    > improvements.


    Most probably a backport to Python 2.6 or even 2.5 under a different
    module name like re_ng wouldn't be too difficult to do for anybody that
    needs the new functionality and knows a bit about building extension
    modules.

    -- Gerhard
     
    Gerhard Häring, Oct 24, 2008
    #3
  4. Peng Yu

    Peng Yu Guest

    > Most probably a backport to Python 2.6 or even 2.5 under a different
    > module name like re_ng wouldn't be too difficult to do for anybody that
    > needs the new functionality and knows a bit about building extension
    > modules.


    I did a google a search. But I don't find any document that describe
    it. Does it have almost the same functionality as the re package that
    will be in Python 2.7? Where is the decumentation of it?

    If I just need variable width look-behind, I just replace re with
    re_ng on python 2.5 or 2.6, right? Is re_ng available on python 2.4?

    Thanks,
    Peng
     
    Peng Yu, Oct 24, 2008
    #4
  5. On Fri, 24 Oct 2008 07:43:16 -0700, Peng Yu wrote:

    >> Most probably a backport to Python 2.6 or even 2.5 under a different
    >> module name like re_ng wouldn't be too difficult to do for anybody that
    >> needs the new functionality and knows a bit about building extension
    >> modules.

    >
    > I did a google a search. But I don't find any document that describe it.
    > Does it have almost the same functionality as the re package that will
    > be in Python 2.7? Where is the decumentation of it?
    >
    > If I just need variable width look-behind, I just replace re with re_ng
    > on python 2.5 or 2.6, right? Is re_ng available on python 2.4?


    re_ng doesn't exist yet, because Python 2.7 doesn't exist yet. 2.6 has
    only just come out -- it will probably be at least a year before 2.7 is
    out, and only then might people start back-porting the new re engine to
    2.5 or 2.6.


    --
    Steven
     
    Steven D'Aprano, Oct 24, 2008
    #5
    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. johnp
    Replies:
    4
    Views:
    3,720
    Toby Inkster
    May 23, 2005
  2. inhahe
    Replies:
    3
    Views:
    2,497
    Diez B. Roggisch
    Jan 28, 2005
  3. Nathan
    Replies:
    2
    Views:
    99
    Nathan
    Apr 9, 2010
  4. Xavier Noria

    variable-width negative look-behind emulation

    Xavier Noria, Sep 13, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    144
    Xavier Noria
    Sep 14, 2003
  5. Replies:
    4
    Views:
    204
Loading...

Share This Page