Sorry, for the misunderstanding.
If there is just a single Data Filter in the report, there is no need to specify the reference more precisely.
On the other hand:
If you want to restrict the title to some part of the Where Clause, you need another Regex expression like the one below.
It searches for any :age == within round brackets and returns the whole string within the brackets.
So, For cases like
"Select Where( (:age == 14 | :age == 15) & :weight >= 113.5 )";
"Select Where(:age == 14 | :age == 16 | :age == 17 )"
it will just return the :age ... part.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(
Size( 570, 518 ),
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :sex, :age, :weight ),
Display( :sex, "Check Box Display" ),
Display( :age, "Check Box Display" )
)
),
SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ) )
);
ldf = Current Report()["Local Data Filter"] << get scriptable object;
changeTitle = Function( {this},
print(this);
ldfText = Regex(ldf << get where clause(),".*\((:age == .*?)\).*","\1");
(Report( gb ) << XPath( "//TextEditBox" ))[1] << Set Text( ldfText );
);
fsh = ldf << Make Filter Change Handler(
changeTitle();
);