9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] ^ and $ in structural expressions
@ 2008-02-29 14:08 Anthony Martin
  2008-02-29 15:48 ` roger peppe
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Martin @ 2008-02-29 14:08 UTC (permalink / raw)
  To: 9fans

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] ^ and $ in structural expressions
  2008-02-29 14:08 [9fans] ^ and $ in structural expressions Anthony Martin
@ 2008-02-29 15:48 ` roger peppe
  2008-02-29 15:53   ` Hongzheng Wang
  0 siblings, 1 reply; 4+ messages in thread
From: roger peppe @ 2008-02-29 15:48 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] ^ and $ in structural expressions
  2008-02-29 15:48 ` roger peppe
@ 2008-02-29 15:53   ` Hongzheng Wang
  2008-02-29 15:58     ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Hongzheng Wang @ 2008-02-29 15:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

And it might also make regexp too complicated.

On Fri, Feb 29, 2008 at 11:48 PM, roger peppe <rogpeppe@gmail.com> 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] ^ and $ in structural expressions
  2008-02-29 15:53   ` Hongzheng Wang
@ 2008-02-29 15:58     ` erik quanstrom
  0 siblings, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2008-02-29 15:58 UTC (permalink / raw)
  To: 9fans

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-29 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-29 14:08 [9fans] ^ and $ in structural expressions Anthony Martin
2008-02-29 15:48 ` roger peppe
2008-02-29 15:53   ` Hongzheng Wang
2008-02-29 15:58     ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).