joe nesbitt wrote:search further to see if the content between the 5th and 6th occurence of the ^ is ""
If it is "", then replace it to be blank/empty
Not to put too fine a point on it, that's as clear as mud. Moreover, only one of your sample inputs is shown to match the two or three conditions you have stated. You need more specific requirements ,and you need to post samples that match and don't match in various ways.
For TEST^ at the start of the line, use a positive zero-width lookbehind.
For the rest, you need to be a lot more clear.