9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
To: 9front@9front.org
Subject: [9front] Re: sed: fix moving '^' match
Date: Fri, 25 Aug 2023 17:04:46 -0700	[thread overview]
Message-ID: <ZOlBnqcGtlMRHsRD@alice> (raw)
In-Reply-To: <26E0B9AD31488853D40C701E19370A2D@eigenstate.org>

ori@eigenstate.org once said:
> Currently, if you do something like:
>
> 	echo aabbccd | sed s/^..//g
>
> it will output simply:
>
> 	'd'
>
> [...]
>
> This patch works by adding a dummy character
> at the start of the line, so we aren't at
> the start of a line after the first sub.
>
> [...]
>
> anyone aware of any unexpected side effets
> that this may have?

It looks like a reasonable change but I'd be hesitant to
make it. Ed(1) produces the same output and the behavior
appears to be unchanged since at least the 8th edition.

It's clearly a rare edge case and easily avoided by not using
the g flag when it's not necessary. I doubt it would break
anything, though.

Cheers,
  Anthony

  reply	other threads:[~2023-08-26  0:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 21:46 [9front] " ori
2023-08-26  0:04 ` Anthony Martin [this message]
2023-08-26  9:14   ` [9front] " hiro
2023-08-26 17:58     ` ori
2023-08-26 18:02     ` ori
2023-08-26  9:05 ` [9front] " hiro
2023-08-26  9:41   ` ieliedonge
2023-08-26 16:48     ` hiro
2023-08-26 18:00       ` ori
2023-08-26 23:23       ` ieliedonge
2023-08-27  8:33         ` hiro
2023-08-27  9:54           ` tlaronde
2023-08-27 11:19             ` ieliedonge
2023-09-23  1:35             ` ieliedonge
2023-09-23 10:30               ` hiro
2023-09-24 15:35               ` ori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZOlBnqcGtlMRHsRD@alice \
    --to=ality@pbrane.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).