Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

substitution groups and patterns i replace string (Emacs' \\1 etc.)



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