CSPACE-6004: Corrected edge case with terms '**{term}', '^*{term}', {term}**, and {term}*^