Trying to match everything except the text in the brackets, excluding the brackets themselves. For example I am trying to match everything but {PRODUCTTYPE}
and {PRODUCTCODE}
in the text below:
^FT14,155^A0N,75,74^FD{PRODUCTTYPE}^FS{PRODUCTCODE}^A0N,75,74^FD
Closest I got was with this regex:
.*(?=\{)|(?=\}).*
The problems are 1. this only works for one of the occurrences and 2. it includes the closing bracket, despite the documentation stating that it excludes the matched group of the result. Ideally using lookarounds, but without also ok. What am I missing?
EDIT I am using a text editor (sublime text), not a programming language. I need the regex to do all the work without programming help. I would like to be able to keep what is underlined in red, so when I hit delete, only what is outside the brackets is deleted:
I know in practice there are other ways to achieve this but I would like to know how to do this with regex. Notepad++ is also ok.