zsh-users
 help / color / mirror / code / Atom feed
* Subscripting without temporaries
@ 2004-04-13 12:00 DervishD
  2004-04-13 15:29 ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: DervishD @ 2004-04-13 12:00 UTC (permalink / raw)
  To: Zsh Users

    Hi all :)

    I have an array containing strings of this type, one per 'slot':

    "Some text [particular text] Another text"

    For each line I want to be able to separate the three parts: the
'Some text', the '[Particular text]', and the 'Another text'. I know
I can do it using things like

    print ${array[EXP]/(#b)(*) (\[*\]) (*)/}

    and I will get the three parts in the $match array, one per slot.
I can do this because I know that the brackets can be used as
separators (they are never present in the first part nor the last
part). The question is that I'm sure that there is another better
method for doing the same without using backreferences and parameter
replacement. I think that, as we say in spanish, I'm using a cannon
to kill flies...

    Which is the zsh-cool-way of doing the same?

    Thanks in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


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

end of thread, other threads:[~2004-04-14 18:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-13 12:00 Subscripting without temporaries DervishD
2004-04-13 15:29 ` Bart Schaefer
2004-04-13 16:40   ` Lloyd Zusman
2004-04-13 17:11     ` Phil Pennock
2004-04-13 18:17       ` Lloyd Zusman
2004-04-13 17:17     ` DervishD
2004-04-13 17:18     ` Bart Schaefer
2004-04-13 19:00     ` Wayne Davison
2004-04-13 17:14   ` DervishD
2004-04-14  1:58     ` Bart Schaefer
2004-04-14 16:13       ` DervishD

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