I need to match a word or expression,on the condition it is not inside curly braces in any way. For example, I need to match only the first word "TARGET" in the following (arbitrary) string:
text text TARGET {text TARGET text text} text text.
The order of appearance may vary, and the string may not even contain curly braces at all. The word TARGET may appear several times outside of curly braces, but I only need the first occurrence.
How do I accomplish this?
Thanks in advance.