zsh-workers
 help / color / mirror / code / Atom feed
* regexp-replace and ^
@ 2015-10-29 19:08 Stephane Chazelas
  2015-10-29 23:46 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Stephane Chazelas @ 2015-10-29 19:08 UTC (permalink / raw)
  To: Zsh hackers list

The way regexp-replace works ^ is going to match in several
places:

$ a=aaa zsh -c 'autoload regexp-replace; regexp-replace a "^a" b; echo $a'
bbb

That should probably be documented. (would also affect the \<, \>, \b, and
various look-ahead operators in PCRE).

Or maybe have a (E) for ERE and (P) for PCRE parameter expansion flags for the
${var//pattern/replacement}.

-- 
Stephane


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

end of thread, other threads:[~2015-10-30 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-29 19:08 regexp-replace and ^ Stephane Chazelas
2015-10-29 23:46 ` Bart Schaefer
2015-10-30 14:27   ` Stephane Chazelas

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