From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11948 invoked by alias); 3 Mar 2016 01:25:43 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21342 Received: (qmail 13200 invoked from network); 3 Mar 2016 01:25:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: zsh-users@zsh.org To: zsh-users@zsh.org From: Emanuel Berg Subject: substitution groups and patterns i replace string (Emacs' \\1 etc.) Date: Thu, 03 Mar 2016 02:08:22 +0100 Message-ID: <87k2lk2ws9.fsf@debian.uxu> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-54.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:xzsDGBTstaHODzzxNsf+Kwc0IZw= 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. ... if, again, the Emacs notation is used to illustrate? -- underground experts united http://user.it.uu.se/~embe8573