Thank You! both of You enlighten me about greatly important thing, that i couldnt find in any documentation or so much commentaries, eg main php manual http://pl2.php.net/manual/pl/function.preg-replace.php - about, that PHP can also take function as replacer! ealrier it was obvious for me it was impossible.
Both solves are working well, but i was affraid that i would have problem to implement either two to my code, finally i turned up that indeed thebadbad #2 wouldnt make trouble as pattern with function stored in array. If I want pkSML version that looks v clear for me, i would have to change preg_replace construction.
<?php
$replace = array('/[\[\{]/', '/[\]\}]/', //change parenthesis [] {} na ()
'/(.*)\.(.*)$/e', //format extension
'/[^\w\s\(\)\-`\.,;\+=#&!]|'. //allow some strange chars in filename _ -() `,.;+=!&#
'^[\s\.,;]*[!&\-#]+[\s,;!&\-#]*/', //format tolerable beggining
'/^[\s\.,;]+|\s+(?=\s.)/'); //or cut, and finally shorten multiple spaces
$with = array('(',')',"trim('$1').'.'.preg_replace('~[\W]~','','$2')",'_','');
printt ('file|'.preg_replace($replace,$with,$str).'|'); //own print for debugging
?>
thanks for help