From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26341 invoked by alias); 6 May 2015 06:28: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: 20178 Received: (qmail 15355 invoked from network); 6 May 2015 06:28:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=bE23trowb8KGB1a8/tNIzOImDyW99l7dOpUNXtVK6wA=; b=AyZFuyOH2xcXZNMrRM5TgmgaWViqVJXY3A62499xs3w7KDqrNn/XbEQb/VVDRtDiAT f+svOAYkYHQAyAwZm80eatr2T4RASxMht4qPXpfPjIn+o9tzPquDHO63V+xM04kBP1Vt C3FXnubIa8tWHxE8RrFWzIaGUgQb5c0kO0z1gCkIsc78Ywf3ygttqbTsY+hNUCT64vbm OtcOs7yWBRfrLoKZurFmHm8vYdRZVG+hWYzdlo56FXdiZCSuXSVZ20l3NyJHWrYMm5Zm 3bBsETOG+a5PgeJ7mNSlS0gTvYEBlazlVNtkG/RtsMZFnQdUIE4qppkpAjAgMfuLiLD+ qsSw== MIME-Version: 1.0 X-Received: by 10.152.22.72 with SMTP id b8mr27169400laf.1.1430893716294; Tue, 05 May 2015 23:28:36 -0700 (PDT) Date: Wed, 6 May 2015 08:28:36 +0200 Message-ID: Subject: Splitting on unquoted equals From: =?UTF-8?Q?Jesper_Nyg=C3=A5rds?= To: Zsh Users Content-Type: multipart/alternative; boundary=089e0158b832abd2c4051563e708 --089e0158b832abd2c4051563e708 Content-Type: text/plain; charset=UTF-8 I am trying to extract url:s from an XML document, where I have fragments resembling the following: Say I assign the above to a variable: % mystring="" Is there a way to split this string on '=' but not within the quotes? If I only do this: % print -l ${(s:=:)mystring} The url has of course been split on '=' as well, which is not what I want. Is there a way to say "split on '=' but not within quotes", similar to the way (z) treats white space? % myspaces="this is \"three arguments\"" % print -l ${(z)myspaces} this is "three arguments" Here the space is preserved within quotes. Is there a way to achieve something similar but with '='? --089e0158b832abd2c4051563e708--