From: Emanuel Berg <embe8573@student.uu.se>
To: zsh-users@zsh.org
Subject: substitution groups and patterns i replace string (Emacs' \\1 etc.)
Date: Thu, 03 Mar 2016 02:08:22 +0100 [thread overview]
Message-ID: <87k2lk2ws9.fsf@debian.uxu> (raw)
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
next reply other threads:[~2016-03-03 1:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 1:08 Emanuel Berg [this message]
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
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=87k2lk2ws9.fsf@debian.uxu \
--to=embe8573@student.uu.se \
--cc=zsh-users@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).