trim_param now accepts regexp arguments