It works perfect when $uri_name is a single string. However it is possible that this string in the input contains spaces. The regexp stops at the first space. Also following the string $uri_name there is a number in inside parenthesis that I do not want to parse.