[9fans] ^ and $ in structural expressions - Plan9

This is a discussion on [9fans] ^ and $ in structural expressions - Plan9 ; In his structural expression paper, Rob briefly mentions that ^ and $ match on line boundaries for compatibility reasons and because of problems with the implementation. Lately, I've been running into situations where it would be convenient to have them ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: [9fans] ^ and $ in structural expressions

  1. [9fans] ^ and $ in structural expressions

    In his structural expression paper, Rob briefly mentions
    that ^ and $ match on line boundaries for compatibility
    reasons and because of problems with the implementation.

    Lately, I've been running into situations where it would
    be convenient to have them match what they should, i.e.,
    the beginning and end of the selected data.

    Rob (and any others that have experimented), could you
    please elaborate on the problems that were encountered?

    My initiative-to-annoyance ratio is approaching one but
    I thought I'd ask here before coding.

    Thanks,
    Anthony

  2. Re: [9fans] ^ and $ in structural expressions

    > Lately, I've been running into situations where it would
    > be convenient to have them match what they should, i.e.,
    > the beginning and end of the selected data.


    i've often wanted something similar, but i'm not sure you can
    re-use ^ and $, as for example ,x/;$/d would stop working.

    i thought perhaps « and » would do the job, but that's
    not considered a good idea.

    here are some relevant articles from the archives:

    http://9fans.net/archive/2003/10/241
    http://9fans.net/archive/2003/10/245
    http://9fans.net/archive/2003/10/340
    http://9fans.net/archive/2003/10/341
    http://9fans.net/archive/2003/10/343

    basically, it might be useful, but there's no way to fit it into the syntax.

  3. Re: [9fans] ^ and $ in structural expressions

    And it might also make regexp too complicated.

    On Fri, Feb 29, 2008 at 11:48 PM, roger peppe wrote:
    > > Lately, I've been running into situations where it would
    > > be convenient to have them match what they should, i.e.,
    > > the beginning and end of the selected data.

    >
    > i've often wanted something similar, but i'm not sure you can
    > re-use ^ and $, as for example ,x/;$/d would stop working.
    >
    > i thought perhaps and would do the job, but that's
    > not considered a good idea.
    >
    > here are some relevant articles from the archives:
    >
    > http://9fans.net/archive/2003/10/241
    > http://9fans.net/archive/2003/10/245
    > http://9fans.net/archive/2003/10/340
    > http://9fans.net/archive/2003/10/341
    > http://9fans.net/archive/2003/10/343
    >
    > basically, it might be useful, but there's no way to fit it into the syntax.
    >




    --
    HZ

  4. Re: [9fans] ^ and $ in structural expressions

    i'm not arguing for or against the idea here, just want to point
    out that i don't think syntax is the limiting factor.

    if « and » are not acceptable, then we can reuse existing characters.
    having ^ and $ loose their idempotency would not be a large inconvience.
    ^^ and $$ could easily do.

    adding an expression anchor should not be a major complication.

    - erik

+ Reply to Thread