zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: backreferences
Date: Fri, 16 Oct 2015 22:16:25 -0700	[thread overview]
Message-ID: <5621D9A9.9090505@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7YKH3oG+DUby8Ow7X8W==qyjqv9e7_d-y7nE23iWTY+Uw@mail.gmail.com>

On 10/16/2015 08:33 PM, Bart Schaefer wrote:

> Only seems to. Try sstring="edcbaabcdeedcbaabcde" and I don't think 
> you'll get the result you expected. 

Correct.  It fails if the very start of the string is the negation, 
which seems strange.  Any change at all to the 'bait' leading 'edcba' 
fixes it.  The empty string is the intuitive expectation for match[1].
>>> This needs to be (#b)(^edcba*)(edcba)(*)
... and that does indeed seem to cover every situation that I've tried.  
Am I correct in reading the '*' as saying: "Anything OR NOTHING in front 
of 'edcba' "?  That's not hard to fathom.  Anyway I guess the difference 
is something that could be put to use in some conceivable situation. BTW 
does sed have that functionality?  I did quite a bit of research and 
came up with nothing.  Even at StackExchange no one had an answer, but 
it seems to me like a very fundamental sort of thing.  Cool if zsh can 
do something that sed can't tho you'd hardly expect that to be the case.
>> There might be something in the Bash to Zsh book -- I don't have it 
>> handy to confirm. 
Nope, nothing that I can find.


      reply	other threads:[~2015-10-17  5:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 18:28 backreferences Ray Andrews
2015-10-15 23:16 ` backreferences Bart Schaefer
2015-10-16  1:16   ` backreferences Ray Andrews
2015-10-16  2:30     ` backreferences Bart Schaefer
2015-10-16  4:11       ` backreferences Mikael Magnusson
2015-10-16  4:27         ` backreferences Kurtis Rader
2015-10-16  5:42           ` backreferences Ray Andrews
2015-10-16  5:05         ` backreferences Bart Schaefer
2015-10-16  5:28           ` backreferences Bart Schaefer
2015-10-16  5:46             ` backreferences Ray Andrews
2015-10-16 11:14         ` backreferences Peter Stephenson
2015-10-16  5:36       ` backreferences Ray Andrews
2015-10-16 12:35         ` backreferences Bart Schaefer
2015-10-16 16:37           ` backreferences Ray Andrews
2015-10-17  3:33             ` backreferences Bart Schaefer
2015-10-17  5:16               ` Ray Andrews [this message]

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=5621D9A9.9090505@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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