zsh-users
 help / color / mirror / code / Atom feed
* Beginning of line matching
@ 2002-03-26 12:31 Ian Lynagh
  2002-03-26 17:26 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Lynagh @ 2002-03-26 12:31 UTC (permalink / raw)
  To: zsh-users


Hi all

I would have expected ${FOO/(#s)/X} and ${${FOO/(#m)(#s)?/X$MATCH}:-X}
to be equivalent, but it seems that only the second one has the desired
effect when FOO is not empty. Is there a reason the first doesn't behave
as I expected?


Thanks
Ian


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

* Re: Beginning of line matching
  2002-03-26 12:31 Beginning of line matching Ian Lynagh
@ 2002-03-26 17:26 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2002-03-26 17:26 UTC (permalink / raw)
  To: Ian Lynagh, zsh-users

On Mar 26, 12:31pm, Ian Lynagh wrote:
} 
} I would have expected ${FOO/(#s)/X} and ${${FOO/(#m)(#s)?/X$MATCH}:-X}
} to be equivalent, but it seems that only the second one has the desired
} effect when FOO is not empty. Is there a reason the first doesn't behave
} as I expected?

AFAICT, it's because "start of string" is considered to begin with the
first real character, thus after the implicit intial empty substring.

This should probably be considered a bug.

Compare ${FOO/()/X}, and also ${FOO//()/X} ...


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

end of thread, other threads:[~2002-03-26 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-26 12:31 Beginning of line matching Ian Lynagh
2002-03-26 17:26 ` Bart Schaefer

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