As your example show, there is only the need to remove trailing text from the filename, where the trailing text contains the name of the file extension, e .g. ' flac' or ' mp3'.
Apply functions like $regexp, $cutRight, $left, $replace, $if, $eql, $ifgreater, and variables like %_filename% and %_extension%.
Examples ...
_FILENAME <== $replace(%_filename%'$',' '%_extension%'$',) _FILENAME <== $trimRight($replace(%_filename%'$',%_extension%'$',)) _FILENAME <== $regexp(%_filename%,'\s+'%_extension%'$',) _FILENAME <== $regexp(%_filename%,'(\s*'%_extension%')*$',)But it would be better you check the other code, which have introduced the failure.
DD.20160417.1804.CEST, DD.20160505.1656.CEST