Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: please consider using PCRE_DOLLAR_ENDONLY (and PCRE_DOTALL) for rematchpcre
- X-seq: zsh-workers 42320
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: please consider using PCRE_DOLLAR_ENDONLY (and PCRE_DOTALL) for rematchpcre
- Date: Tue, 23 Jan 2018 13:55:25 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rpsA+sDNFm7adJBEvoG6fsaUBQ4GGRVNlOBI8veRyBM=; b=R1eSyHh4HdR1Vt2zQJNV7eCPpA7WWZ3wm8xGZei1YGgZuBOKAnEWf7gbMLSpga4JDL EpMvKsbEkwtb3iPeKo4porEbgTLa+xv5yYm2U9Yswomkokdk4kpcCoIiG1SwK0EHQKwz owr5faRto/Vm1/fIhzFYhUZn6oJjJukeDKz6Tj0nhuOhhZNV/FnG6XaklZMJCRb5ArNn QqYIwpD/s/bGk+8w3O/X0aLirMAcSIcopynwMKPEmkBUBHiVUpvKe9+pmmW5sJQUxXSd dEWmSGl2ohEvdsUe9gSpwFGLfah5imJ/jLxo7SNvce/psTJtp0Edzkcn7s/eD9N9OxHK 2vOQ==
- In-reply-to: <20180123065735.GA16678@chaz.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20171122122519.GA13771@chaz.gmail.com> <20171122214025.GA2992@chaz.gmail.com> <180119234824.ZM7254@torch.brasslantern.com> <20180122052829.GA83799@tower.spodhuis.org> <20180123065735.GA16678@chaz.gmail.com>
2018-01-23 06:57:35 +0000, Stephane Chazelas:
[...]
> It's more about single-line where the line delimiter happens to
> be included (and you want the $ to match on the end of that line
> as opposed to the end of the string).
[...]
I've been trying to imagine a use case that could be broken by
the change (of adding PCRE_DOLLAR_ENDONLY).
One case could be with $mapfile[file] (which does expand to the
full content of the file) for text files with a single line, like
set -o rematchpcre
zmodload zsh/mapfile
[[ $mapfile[/etc/debian_version] =~ '/sid$' ]]
Which would have to be changed to:
[[ $mapfile[/etc/debian_version] =~ '/sid\n?$' ]]
or
[[ $mapfile[/etc/debian_version] =~ '/(?m)sid$' ]]
though personally, I'd rather do:
[[ $(</etc/debian_version) = */sid ]]
Or
grep -q '/sid$' /etc/debian_version
Can anyone think of less far-fetched ones?
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author