Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Beginning of line matching



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   



Messages sorted by: Reverse Date, Date, Thread, Author