zsh-users
 help / color / mirror / code / Atom feed
* substitution groups and patterns i replace string (Emacs' \\1 etc.)
@ 2016-03-03  1:08 Emanuel Berg
  2016-03-03  9:41 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Emanuel Berg @ 2016-03-03  1:08 UTC (permalink / raw)
  To: zsh-users

When I do substitution, can I do groups and patterns
like in Emacs with \\1, \\2 to reference the
particular matches, and thus construct the replace
string out of them any way I like?
        
Or, can I feed the match to a function which I define
myself which returns the replace string? I think I can
bash it together tho it won't be as elegant...

I particular, I'm doing text-to-HTML conversion so
I want to search for http://... the URLs in the text.
To search for them is easy enough but how do I use the
result (the match string) to construct the
replacement, i.e. <a href="\\1"> ... </a> if, again,
the Emacs notation is used to illustrate?

-- 
underground experts united
http://user.it.uu.se/~embe8573


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

end of thread, other threads:[~2016-03-08  2:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-03  1:08 substitution groups and patterns i replace string (Emacs' \\1 etc.) Emanuel Berg
2016-03-03  9:41 ` Peter Stephenson
2016-03-06  5:57   ` Emanuel Berg
2016-03-06  7:15     ` Mikael Magnusson
2016-03-08  2:52       ` Bart Schaefer

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