improve handling ${workspace_loc} to allow usage of environment variable

at the moment there is a bug that is visible if in configuration there are environment variable like ${ENV} and it is replaced by ${ENV 
It solves the issue by using regular expression replace instead of string based one.