I have a string like so:
<p>Year: ={year}</p>\
<p>Director: ={director}</p>\
<ul>@{actors}<li class="#{class}">={actor}</li>{actors}</ul>\
And I want to extract all ={match}
that are NOT inside @{word}...{word}
, so in this case I want to match ={year}
and ={director}
but not ={actor}
. This is what I got so far but it's not working.
/(?!@.*)=\{([^{}]+)\}/g
Any ideas?
Edit: My current solution is to find all ={match}
inside @{}...{}
and replace the =
with something like =&
. Then I grab the ones that are outside and finally I come back and replace the flagged ones back to their original state.
always? – Michael Feb 05 '13 at 07:29