Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
substitution groups and patterns i replace string (Emacs' \\1 etc.)
- X-seq: zsh-users 21342
- From: Emanuel Berg <embe8573@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: substitution groups and patterns i replace string (Emacs' \\1 etc.)
- Date: Thu, 03 Mar 2016 02:08:22 +0100
- Cancel-lock: sha1:xzsDGBTstaHODzzxNsf+Kwc0IZw=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-copies-to: never
- Mail-followup-to: zsh-users@xxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author