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

Re: Regex not halt caputre second slash



On Mon, Aug 14, 2023, at 7:07 PM, Budi wrote:
> OMG
>
> Finally found one of the most subtle trooubles in Zsh:
>
> MUST ENCLOSE ZSH REGEX IN DOUBLE QUOTE PAIR, " "

Demonstrably untrue, in general.

	% var=/a/b/c/d/
	% [[ $var =~ .* ]] && typeset -p MATCH
	typeset MATCH=/a/b/c/d/
	% setopt RE_MATCH_PCRE
	% [[ $var =~ .* ]] && typeset -p MATCH
	typeset MATCH=/a/b/c/d/

-- 
vq




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