Variable Set %TestData to %new_val
Variable Set %TestData to *
Have you read pattern matching and the variable section within Taskers user guide?
As you have found there are different ways to approch this however take a look into escaping variable names.
Also maybe look into your approach with %new_val something like below.
If [ %new_val Set & %new_val !~ \%new_val ]
Variable Set [ Name:%value To:new_val Do Maths:Off Append:Off ]
If [ %value ~R [someregex] ]
Variable Set [ Name:%MyValue To:%value Do Maths:Off Append:Off ]
else...