How can I split this string while saving quoted strings
>div#a.more.style.ui[url="in.tray"]{value}
where are the characters to break
> # . [ {
To obtain:
>div
#a
.more
.style
.ui
[url="in.tray"]
{value}
Current effort:
\>|\[|\{|#|\.?(?:(["'])(?:\\?.)*?\1)*
with section "in.tray".
Update 1:
The solution should be regular, because the template is assembled from the keys of the JS object in the existing code, which:
JSObject
'>': function ...
'^': function ...
'[': function ...
...
with functions used as callbacks to handle regexp output.
The target line represents a macro Emmet and simple symbols may comprise for starting and possible recurrence of at least ^, $for processing as separate elements, for example:
p>div>div>span^h2^^h1>div#a.li^mo+re.st*yle.ui[url="in.tray"]{value}$$$
Current efforts based on @ tim-pietzcker , using .match(), but with a blank last filtered response:
[a-z$^+*>#.[{]{0,1}(?:"[^"]*"|[^"$^+*>#.[{]){0,}