Implementing joint consideration of both opening and closing brackets when parsing strings. Direct text scanning approach also significantly improves parse speed and removes an unnecessary array allocation and copy.