zsh-workers
 help / color / mirror / code / Atom feed
From: "Lawrence Velázquez" <larryv@zsh.org>
To: Budi <budikusasi@gmail.com>, "Eric Cook" <llua@gmx.com>
Cc: zsh-workers@zsh.org
Subject: Re: Regex not halt caputre second slash
Date: Mon, 14 Aug 2023 20:24:02 -0400	[thread overview]
Message-ID: <77463bdb-b418-4abe-a291-32a5c138b254@app.fastmail.com> (raw)
In-Reply-To: <CAH0GyZBe9aUnnprCsERrW1sE4aGkQBcYwdwFZ7kGMmXG2-dAqQ@mail.gmail.com>

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


      reply	other threads:[~2023-08-15  0:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 10:41 Budi
2023-08-14 12:59 ` Eric Cook
2023-08-14 23:07   ` Budi
2023-08-15  0:24     ` Lawrence Velázquez [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=77463bdb-b418-4abe-a291-32a5c138b254@app.fastmail.com \
    --to=larryv@zsh.org \
    --cc=budikusasi@gmail.com \
    --cc=llua@gmx.com \
    --cc=zsh-workers@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).