The simplest way to accomplish this is probably via an expression evaluator, using the str:regExCapture EL function. For example, this should work (for the Field Expression):
${str:regExCapture(record:value('/text'), '.*\$$(.*)\$$[^(]*$', 1)}