trim input before mathing (is_regexp improvement)