From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15095 invoked by alias); 6 May 2015 07:06:29 -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: 20179 Received: (qmail 15141 invoked from network); 6 May 2015 07:06:27 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=fg+H/U5t6OO7ZkUj375kbmVYMjJbivMESAhFwkEkYvc=; b=AUmmjnOMONS7EfxxFRmtoCAORXDGZL2qhcTqNIEPeDlJdUFK3jLE2UUWKG9UYAnVXK CXTcftP89FTK+Q4SCLSia+lck/hgjQgutqUWxqWTsHwPZZ/v5izm5nGDDAJilZ01BO4q OOH/poMWfVx4k3xQVgmTkMzDZ8fpxnSdtoltIK5coZZ8I64X5MHo6ZO8gr7ZwcISyj3A hrVLGVYt2I982wNQxRJuZluYghVCWfGMQW5I21XQBfjokF4bLAT8bz/YePU9jzQyuX+u e1MMIG7ug35D8A4XgKx+Q8KoyEMM1x5ZJhjZjZjrRMw3ZiqcFiPbOn4+CbftaU56yglB cKqA== X-Gm-Message-State: ALoCoQkyID9ScSbHHcd7Mu8M/bvSrrpbPrT7AJY2mpOSFChwjGLqR6bY8EcQOEwwpsWL02MUmkuu X-Received: by 10.60.52.19 with SMTP id p19mr25753934oeo.37.1430895982705; Wed, 06 May 2015 00:06:22 -0700 (PDT) From: Bart Schaefer Message-Id: <150506000620.ZM19100@torch.brasslantern.com> Date: Wed, 6 May 2015 00:06:20 -0700 In-Reply-To: Comments: In reply to Jesper Nygards "Splitting on unquoted equals" (May 6, 8:28am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Splitting on unquoted equals MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 6, 8:28am, Jesper Nygards wrote: } } Is there a way to say "split on '=' but not within quotes", similar to the } way (z) treats white space? Not really. (z) works because it "understands" shell syntax. You are asking for the shell to "understand" HTML syntax. It does not. You have two choices: (1) Write an actual HTML element parser, in shell script. (Probably easier to use Perl HTML::Parser or similar.) (2) Approach the problem differently. For example, if you first split on double-quotes and spaces and then strip off trailing equal signs: torch% print -l ${${=${(s'"')mystring}}%=} Curious aside - this doesn't work: torch% print -l ${(s:\":)string} But you can't use an un-escaped quote mark there either: torch% print -l ${(s:":)string} braceparam dquote> -- Barton E. Schaefer