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 '='?